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 digital invariant (PDI) is a number 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 ...
(
) that is the sum of its own digits each raised to a given
power
Power most often refers to:
* Power (physics), meaning "rate of doing work"
** Engine power, the power put out by an engine
** Electric power
* Power (social and political), the ability to influence people or events
** Abusive power
Power may a ...
(
).
[''Perfect and PluPerfect Digital Invariants''](_blank)
by Scott Moore
by Harvey Heinz
Definition
Let be 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 ...
. The perfect digital invariant function (also known as a happy function, from 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 ...
s) for base and power is defined as:
:
where is the number of digits in the number in base , and
:
is the value of each digit of the number. A natural number is a perfect digital invariant if it is a fixed point for , which occurs if . and are trivial perfect digital invariants for all and , all other perfect digital invariants are nontrivial perfect digital invariants.
For example, the number 4150 in base is a perfect digital invariant with , because .
A natural number is a sociable digital 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 , where for a positive 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 ...
(here is the th iterate
Iteration is the repetition of a process in order to generate a (possibly unbounded) sequence of outcomes. Each repetition of the process is a single iteration, and the outcome of each iteration is then the starting point of the next iteration. ...
of ), and forms a cycle of period . A perfect digital invariant is a sociable digital invariant with , and a amicable digital invariant is a sociable digital invariant with .
All natural numbers are preperiodic points for , regardless of the base. This is because if , , so any will satisfy until . There are a finite number of natural numbers less than , so the number is guaranteed to reach a periodic point or a fixed point less than , making it a preperiodic point.
Numbers in base lead to fixed or periodic points of numbers .
The number of iterations needed for to reach a fixed point is the perfect digital invariant function's persistence of , and undefined if it never reaches a fixed point.
is the digit sum
In mathematics, the digit sum of a natural number in a given number base is the sum of all its digits. For example, the digit sum of the decimal number 9045 would be 9 + 0 + 4 + 5 = 18.
Definition
Let n be a natural number. We define the digit ...
. The only perfect digital invariants are the single-digit numbers in base , and there are no periodic points with prime period greater than 1.
reduces to , as for any power , and .
For every natural number , if , and , then for every natural number , if , then , where is Euler's totient function
In number theory, Euler's totient function counts the positive integers up to a given integer that are relatively prime to . It is written using the Greek letter phi as \varphi(n) or \phi(n), and may also be called Euler's phi function. In ot ...
.
No upper bound can be determined for the size of perfect digital invariants in a given base and arbitrary power, and it is not currently known whether or not the number of perfect digital invariants for an arbitrary base is finite or infinite.
''F''2,''b''
By definition, any three-digit perfect digital invariant for with natural number digits , , has to satisfy the cubic Diophantine equation . has to be equal to 0 or 1 for any , because the maximum value can take is . As a result, there are actually two related quadratic Diophantine equations to solve:
: when , and
: when .
The two-digit natural number is a perfect digital invariant in base
:
This can be proven by taking the first case, where , and solving for . This means that for some values of and , is not a perfect digital invariant in any base, as is not a divisor
In mathematics, a divisor of an integer n, also called a factor of n, is an integer m that may be multiplied by some integer to produce n. In this case, one also says that n is a multiple of m. An integer n is divisible or evenly divisible by ...
of . Moreover, , because if or , then , which contradicts the earlier statement that .
There are no three-digit perfect digital invariants for , which can be proven by taking the second case, where , and letting and . Then the Diophantine equation for the three-digit perfect digital invariant becomes
:
:
:
:
for all values of . Thus, there are no solutions to the Diophantine equation, and there are no three-digit perfect digital invariants for .
''F''3,''b''
By definition, any four-digit perfect digital invariant for with natural number digits , , , has to satisfy the quartic Diophantine equation . has to be equal to 0, 1, 2 for any , because the maximum value can take is . As a result, there are actually three related cubic Diophantine equations to solve
: when
: when
: when
We take the first case, where .
''b'' = 3''k'' + 1
Let be a positive integer and the number base . Then:
* is a perfect digital invariant for for all .
* is a perfect digital invariant for for all .
* is a perfect digital invariant for for all .
''b'' = 3''k'' + 2
Let be a positive integer and the number base . Then:
* is a perfect digital invariant for for all .
''b'' = 6''k'' + 4
Let be a positive integer and the number base . Then:
* is a perfect digital invariant for for all .
''F''''p'',''b''
All numbers are represented in base .
Extension to negative integers
Perfect digital invariants can be extended to the negative integers by use of a signed-digit representation
In mathematical notation for numbers, a signed-digit representation is a positional numeral system with a set of signed digits used to encode the integers.
Signed-digit representation can be used to accomplish fast addition of integers because ...
to represent each integer.
Balanced ternary
In balanced ternary
Balanced ternary is a ternary numeral system (i.e. base 3 with three digits) that uses a balanced signed-digit representation of the integers in which the digits have the values −1, 0, and 1. This stands in contrast to the standard (unbalance ...
, the digits are 1, −1 and 0. This results in the following:
* With odd
Odd means unpaired, occasional, strange or unusual, or a person who is viewed as eccentric.
Odd may also refer to:
Acronym
* ODD (Text Encoding Initiative) ("One Document Does it all"), an abstracted literate-programming format for describing X ...
powers , reduces down to digit sum
In mathematics, the digit sum of a natural number in a given number base is the sum of all its digits. For example, the digit sum of the decimal number 9045 would be 9 + 0 + 4 + 5 = 18.
Definition
Let n be a natural number. We define the digit ...
iteration, as , and .
* With even
Even may refer to:
General
* Even (given name), a Norwegian male personal name
* Even (surname)
* Even (people), an ethnic group from Siberia and Russian Far East
** Even language, a language spoken by the Evens
* Odd and Even, a solitaire game w ...
powers , indicates whether the number is even or odd, as the sum of each digit will indicate divisibility by 2 if and only if
In logic and related fields such as mathematics and philosophy, "if and only if" (shortened as "iff") is a biconditional logical connective between statements, where either both statements are true or both are false.
The connective is bicondi ...
the sum of digits ends in 0. As and , for every pair of digits 1 or −1, their sum is 0 and the sum of their squares is 2.
Relation to happy numbers
A happy number for a given base and a given power is a preperiodic point for the perfect digital invariant function such that the -th iteration of is equal to the trivial perfect digital invariant , and an unhappy number is one such that there exists no such .
Programming example
The example below implements the perfect digital invariant function described in the definition above to search for perfect digital 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 ...
. This can be used to find happy numbers.
def pdif(x: int, p: int, b: int) -> int:
"""Perfect digital invariant function."""
total = 0
while x > 0:
total = total + pow(x % b, p)
x = x // b
return total
def pdif_cycle(x: int, p: int, b: int) -> List nt
seen = []
while x not in seen:
seen.append(x)
x = pdif(x, p, b)
cycle = []
while x not in cycle:
cycle.append(x)
x = pdif(x, p, 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
* 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
* 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 digit-to-digit invariant In number theory, a perfect digit-to-digit invariant (PDDI; also known as a Munchausen number) is a natural number 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, bec ...
* 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
Digital Invariants
{{Classes of natural numbers
Arithmetic dynamics
Base-dependent integer sequences
Diophantine equations