HOME

TheInfoList



OR:

In
number theory Number theory (or arithmetic or higher arithmetic in older usage) is a branch of pure mathematics devoted primarily to the study of the integers and integer-valued functions. German mathematician Carl Friedrich Gauss (1777–1855) said, "Math ...
, a perfect digit-to-digit invariant (PDDI; also known as a Munchausen number) is a
natural number In mathematics, the natural numbers are those numbers used for counting (as in "there are ''six'' coins on the table") and ordering (as in "this is the ''third'' largest city in the country"). Numbers used for counting are called '' cardinal ...
in a given number base 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 = 3^3 + 4^4 + 3^3 + 5^5. The term "Munchausen number" was coined by Dutch mathematician and software engineer Daan van Berkel in 2009, as this evokes the story of
Baron Munchausen Baron Munchausen (; ) is a fictional German nobleman created by the German writer Rudolf Erich Raspe in his 1785 book '' Baron Munchausen's Narrative of his Marvellous Travels and Campaigns in Russia''. The character is loosely based on a real ...
raising himself up by his own ponytail because each digit is raised to the power of itself.Daan van Berkel,
''On a curious property of 3435.''
/ref>


Definition

Let n be a natural number which can be written in base b as the k-digit number d_d_...d_d_ where each digit d_i is between 0 and b-1 inclusive, and n = \sum_^ d_b^. We define the function F_b : \mathbb \rightarrow \mathbb as F_b(n) = \sum_^ ^. (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.) A natural number n is defined to be a perfect digit-to-digit invariant in base b if F_b(n) = n. For example, the number 3435 is a perfect digit-to-digit invariant in base 10 because 3^3 + 4^4 + 3^3 + 5^5 = 27 + 256 + 27 + 3125 = 3435. F_b(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 0^0 = 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 In mathematics, in the study of iterated functions and dynamical systems, a periodic point of a function is a point which the system returns to after a certain number of function iterations or a certain amount of time. Iterated functions Given ...
for F_, where F_^k(n) = n for a positive integer k, and forms a
cycle Cycle, cycles, or cyclic may refer to: Anthropology and social sciences * Cyclic history, a theory of history * Cyclical theory, a theory of American political history associated with Arthur Schlesinger, Sr. * Social cycle, various cycles in soc ...
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 F_b, regardless of the base. This is because all natural numbers of base b with k digits satisfy b^ \leq n \leq (k)^. However, when k \geq b+1, then b^ > (k)^, so any n will satisfy n > F_b(n) until n < b^. There are a finite number of natural numbers less than b^, so the number is guaranteed to reach a periodic point or a fixed point less than b^, 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 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


Convention 00 = 0


Programming examples

The following program in Python determines whether an
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the language ...
number is a Munchausen Number / Perfect Digit to Digit Invariant or not, following the convention 0^0 = 1. num = int(input("Enter number:")) temp = num s = 0.0 while 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 implements 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 nt 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 nt 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

*
Arithmetic dynamics Arithmetic dynamics is a field that amalgamates two areas of mathematics, dynamical systems and number theory. Classically, discrete dynamics refers to the study of the iteration of self-maps of the complex plane or real line. Arithmetic dynamics is ...
* Dudeney number * Factorion *
Happy number In number theory, a happy number is a number which eventually reaches 1 when replaced by the sum of the square of each digit. For instance, 13 is a happy number because 1^2+3^2=10, and 1^2+0^2=1. On the other hand, 4 is not a happy number because ...
* Kaprekar's constant *
Kaprekar number In mathematics, a natural number in a given number base is a p-Kaprekar number if the representation of its square in that base can be split into two parts, where the second part has p digits, that add up to the original number. The numbers are ...
* Meertens number * Narcissistic number *
Perfect digital invariant In number theory, a perfect digital invariant (PDI) is a number in a given number base (b) that is the sum of its own digits each raised to a given power (p). 0 F_ : \mathbb \rightarrow \mathbb is defined as: :F_(n) = \sum_^ d_i^p. where k = \lfl ...
* Sum-product number


References


External links

* {{Classes of natural numbers Arithmetic dynamics Base-dependent integer sequences Articles with example Python (programming language) code