Perfect digit-to-digit invariant explained

b

that is equal to the sum of its digits each raised to the power of itself. An example in base 10 is 3435, because

3435=33+44+33+55

. The term "Munchausen number" was coined by Dutch mathematician and software engineer Daan van Berkel in 2009,[2] as this evokes the story of Baron Munchausen raising himself up by his own ponytail because each digit is raised to the power of itself.[3] [4]

Definition

Let

n

be a natural number which can be written in base

b

as the k-digit number

dk-1dk-2...d1d0

where each digit

di

is between

0

and

b-1

inclusive, and

n=

k-1
\sum
i=0

dibi

. We define the function

Fb:NN

as

Fb(n)=

k-1
\sum
i=0
di
{d
i}
. (As 00 is usually undefined, there are typically two conventions used, one where it is taken to be equal to one, and another where it is taken to be equal to zero.[5] [6]) A natural number

n

is defined to be a perfect digit-to-digit invariant in base b if

Fb(n)=n

. For example, the number 3435 is a perfect digit-to-digit invariant in base 10 because

33+44+33+55=27+256+27+3125=3435

.

Fb(1)=1

for all

b

, and thus 1 is a trivial perfect digit-to-digit invariant in all bases, and all other perfect digit-to-digit invariants are nontrivial. For the second convention where

00=0

, both

0

and

1

are trivial perfect digit-to-digit invariants.

A natural number

n

is a sociable digit-to-digit invariant if it is a periodic point for

Fb

, where
k(n)
F
b

=n

for a positive integer

k

, and forms a cycle of period

k

. A perfect digit-to-digit invariant is a sociable digit-to-digit invariant with

k=1

. An amicable digit-to-digit invariant is a sociable digit-to-digit invariant with

k=2

.

All natural numbers

n

are preperiodic points for

Fb

, regardless of the base. This is because all natural numbers of base

b

with

k

digits satisfy

bk-1\leqn\leq(k){(b-1)}b-1

. However, when

k\geqb+1

, then

bk-1>(k){(b-1)}b-1

, so any

n

will satisfy

n>Fb(n)

until

n<bb+1

. There are a finite number of natural numbers less than

bb+1

, so the number is guaranteed to reach a periodic point or a fixed point less than

bb+1

, making it a preperiodic point. This means also that there are a finite number of perfect digit-to-digit invariant and cycles for any given base

b

.

The number of iterations

i

needed for
i
F
b

(n)

to reach a fixed point is the

b

-factorion function's persistence of

n

, and undefined if it never reaches a fixed point.

Perfect digit-to-digit invariants and cycles of Fb for specific b

All numbers are represented in base

b

.

Convention 00 = 1

BaseNontrivial perfect digit-to-digit invariants (

n1

)
Cycles
210

\varnothing

312, 222 → 11 → 2
4131, 3132 → 10 → 2
5

\varnothing

2 → 4 → 2011 → 12 → 10 → 2

104 → 2013 → 113 → 104

622352, 234524 → 1104 → 1111 → 4

23445 → 24552 → 50054 → 50044 → 24503 → 23445

71345412066 → 536031 → 265204 → 265623 → 551155 → 51310 → 12125 → 12066
8405 → 6466 → 421700 → 3110776 → 6354114 → 142222 → 421 → 405
931, 156262, 1656547
103435
11
123A67A54832

Convention 00 = 0

BaseNontrivial perfect digit-to-digit invariants (

n0

,

n1

)
Cycles
2

\varnothing

\varnothing

312, 222 → 11 → 2
4130, 131, 313

\varnothing

5103, 20242 → 4 → 2011 → 11 → 2

9 → 2012 → 9

622352, 234525 → 22245 → 23413 → 1243 → 1200 → 5

53 → 22332 → 150 → 22250 → 22305 → 22344 → 2311 → 53

713454
8400, 401
930, 31, 156262, 1647063, 1656547, 34664084
103435, 438579088
11

\varnothing

\varnothing

123A67A54832

Programming examples

The following program in Python determines whether an integer number is a Munchausen Number / Perfect Digit to Digit Invariant or not, following the convention

00=1

.num = int(input("Enter number:"))temp = nums = 0.0while num > 0: digit = num % 10 num //= 10 s+= pow(digit, digit) if s

temp: print("Munchausen Number")else: print("Not Munchausen Number")

The examples below implement the perfect digit-to-digit invariant function described in the definition above to search for perfect digit-to-digit invariants and cycles in Python for the two conventions.

Convention 00 = 1

def pddif(x: int, b: int) -> int: total = 0 while x > 0: total = total + pow(x % b, x % b) x = x // b return total

def pddif_cycle(x: int, b: int) -> list[int]: seen = [] while x not in seen: seen.append(x) x = pddif(x, b) cycle = [] while x not in cycle: cycle.append(x) x = pddif(x, b) return cycle

Convention 00 = 0

def pddif(x: int, b: int) -> int: total = 0 while x > 0: if x % b > 0: total = total + pow(x % b, x % b) x = x // b return total

def pddif_cycle(x: int, b: int) -> list[int]: seen = [] while x not in seen: seen.append(x) x = pddif(x, b) cycle = [] while x not in cycle: cycle.append(x) x = pddif(x, b) return cycle

See also

External links

Notes and References

  1. van Berkel. Daan. On a curious property of 3435. 2009. 0911.3038. math.HO .
  2. Olry, Regis and Duane E. Haines. "Historical and Literary Roots of Münchhausen Syndromes", from Literature, Neurology, and Neuroscience: Neurological and Psychiatric Disorders, Stanley Finger, Francois Boller, Anne Stiles, eds. Elsevier, 2013. p.136.
  3. Daan van Berkel, On a curious property of 3435.
  4. Book: Parker. Matt. Things to Make and Do in the Fourth Dimension. 2014. Penguin UK. 9781846147654. 28. 2 May 2015.
  5. http://www.magic-squares.net/narciss.htm Narcisstic Number
  6. Book: Wells , David . The Penguin Dictionary of Curious and Interesting Numbers . Penguin . London . 1997 . 185 . 0-14-026149-4.