Munchausen Number
   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 arithmetic function, integer-valued functions. German mathematician Carl Friedrich Gauss (1777â ...
, 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 n ...
in a given
number base In a positional numeral system, the radix or base is the number of unique digits, including the digit zero, used to represent numbers. For example, for the decimal/denary system (the most common system in use today) the radix (base number) is t ...
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 a ...
for F_, where F_^k(n) = 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 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 Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
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 Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
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 In number theory, a Dudeney number in a given number base b is a natural number equal to the perfect cube of another natural number such that the digit sum of the first natural number is equal to the second. The name derives from Henry Dudeney, who ...
*
Factorion In number theory, a factorion in a given number base b is a natural number that equals the sum of the factorials of its digits. The name factorion was coined by the author Clifford A. Pickover. Definition Let n be a natural number. For a base b > ...
*
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 In number theory, Kaprekar's routine is an iterative algorithm that, with each iteration, takes a natural number in a given number base, creates two new numbers by sorting the digits of its number by descending and ascending order, and subtracts th ...
*
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 n ...
*
Meertens number In number theory and mathematical logic, a Meertens number in a given number base b is a natural number that is its own Gödel number. It was named after Lambert Meertens by Richard S. Bird as a present during the celebration of his 25 years at th ...
*
Narcissistic number In number theory, a narcissistic number 1 F_ : \mathbb \rightarrow \mathbb to be the following: : F_(n) = \sum_^ d_i^k. where k = \lfloor \log_ \rfloor + 1 is the number of digits in the number in base b, and : d_i = \frac is the value of each d ...
*
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 = \lfloo ...
*
Sum-product number A sum-product number in a given number base b is a natural number that is equal to the product of the sum of its digits and the product of its digits. There are a finite number of sum-product numbers in any given base b. 1 F_ : \mathbb \rightarro ...


References


External links

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