Perfect digital invariant

Last updated

In number theory, a perfect digital invariant (PDI) is a number in a given number base () that is the sum of its own digits each raised to a given power (). [1] [2]

Contents

Definition

Let be a natural number. The perfect digital invariant function (also known as a happy function, from happy numbers) 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 for , where for a positive integer (here is the th iterate 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 .

Proof

If , then the bound can be reduced. Let be the number for which the sum of squares of digits is largest among the numbers less than .

because

Let be the number for which the sum of squares of digits is largest among the numbers less than .

because

Let be the number for which the sum of squares of digits is largest among the numbers less than .

Let be the number for which the sum of squares of digits is largest among the numbers less than .

. Thus, numbers in base lead to cycles or fixed 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. 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.

Proof

Let

be a natural number with digits, where , and , where is a natural number greater than 1.

According to the divisibility rules of base , if , then if , then the digit sum

If a digit , then . According to Euler's theorem, if , . Thus, if the digit sum , then .

Therefore, for any natural number , if , and , then for every natural number , if , then .

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. [1]

F2,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 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 .

F3,b

There are just four numbers, after unity, which are the sums of the cubes of their digits:

These are odd facts, very suitable for puzzle columns and likely to amuse amateurs, but there is nothing in them which appeals to the mathematician. (sequence A046197 in the OEIS)
G. H. Hardy, A Mathematician's Apology

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 = 3k + 1

Let be a positive integer and the number base . Then:

Proof

Let the digits of be , , and . Then

Thus is a perfect digital invariant for for all .

Proof

Let the digits of be , , and . Then

Thus is a perfect digital invariant for for all .

Proof

Let the digits of be , , and . Then

Thus is a perfect digital invariant for for all .

Perfect digital invariants
1 4 130131203
27250251305
3 10 370371407
413490491509
5 16 5B05B160B
6196D06D170D
7227F07F180F
8258H08H190H
9289J09J1A0J

b = 3k + 2

Let be a positive integer and the number base . Then:

Proof

Let the digits of be , , and . Then

Thus is a perfect digital invariant for for all .

Perfect digital invariants
1 5 103
2 8 205
311307
414409
51750B
6 20 60D
72370F
82680H
92990J

b = 6k + 4

Let be a positive integer and the number base . Then:

Proof

Let the digits of be , , and . Then

Thus is a perfect digital invariant for for all .

Perfect digital invariants
0 4 021
1 10 153
2 16 285
3223B7
4284E9

Fp,b

All numbers are represented in base .

Nontrivial perfect digital invariantsCycles
2 3 12, 222 → 11 → 2
4
5 23, 334 → 31 → 20 → 4
6 5 → 41 → 25 → 45 → 105 → 42 → 32 → 21 → 5
713, 34, 44, 632 → 4 → 22 → 11 → 2

16 → 52 → 41 → 23 → 16

8 24, 64

4 → 20 → 4

5 → 31 → 12 → 5

15 → 32 → 15

9 45, 55

58 → 108 → 72 → 58

75 → 82 → 75

10 4 → 16 → 37 → 58 → 89 → 145 → 42 → 20 → 4
1156, 66

5 → 23 → 12 → 5

68 → 91 → 75 → 68

12 25, A5

5 → 21 → 5

8 → 54 → 35 → 2A → 88 → A8 → 118 → 56 → 51 → 22 → 8

18 → 55 → 42 → 18

68 → 84 → 68

1314, 36, 67, 77, A6, C428 → 53 → 28

79 → A0 → 79

98 → B2 → 98

141B → 8A → BA → 11B → 8B → D3 → CA → 136 → 34 → 1B

29 → 61 → 29

1578, 882 → 4 → 11 → 2

8 → 44 → 22 → 8

15 → 1B → 82 → 48 → 55 → 35 → 24 → 15

2B → 85 → 5E → EB → 162 → 2B

4E → E2 → D5 → CE → 17A → A0 → 6A → 91 → 57 → 4E

9A → C1 → 9A

D6 → DA → 12E → D6

16 D → A9 → B5 → 92 → 55 → 32 → D
3 3 1222 → 22 → 121 → 101 → 2
4 20, 21, 130, 131, 203, 223, 313, 332
5 103, 43314 → 230 → 120 → 14
6 243, 514, 105513 → 44 → 332 → 142 → 201 → 13
712, 22, 250, 251, 305, 505

2 → 11 → 2

13 → 40 → 121 → 13

23 → 50 → 236 → 506 → 665 → 1424 → 254 → 401 → 122 → 23

51 → 240 → 132 → 51

160 → 430 → 160

161 → 431 → 161

466 → 1306 → 466

516 → 666 → 1614 → 552 → 516

8 134, 205, 463, 660, 661662 → 670 → 1057 → 725 → 734 → 662
9 30, 31, 150, 151, 570, 571, 1388

38 → 658 → 1147 → 504 → 230 → 38

152 → 158 → 778 → 1571 → 572 → 578 → 1308 → 660 → 530 → 178 → 1151 → 152

638 → 1028 → 638

818 → 1358 → 818

10 153, 370, 371, 407

55 → 250 → 133 → 55

136 → 244 → 136

160 → 217 → 352 → 160

919 → 1459 → 919

1132, 105, 307, 708, 966, A06, A64

3 → 25 → 111 → 3

9 → 603 → 201 → 9

A → 82A → 1162 → 196 → 790 → 895 → 1032 → 33 → 4A → 888 → 1177 → 576 → 5723 → A3 → 8793 → 1210 → A

25A → 940 → 661 → 364 → 25A

366 → 388 → 876 → 894 → A87 → 1437 → 366

49A → 1390 → 629 → 797 → 1077 → 575 → 49A

12 577, 668, A83, 11AA
13490, 491, 509, B8513 → 22 → 13
14136, 409
15C3A, D87
1623, 40, 41, 156, 173, 208, 248, 285, 4A5, 580, 581, 60B, 64B, 8C0, 8C1, 99A, AA9, AC3, CA8, E69, EA0, EA1
4 3

121 → 200 → 121

122 → 1020 → 122

4 1103, 33033 → 1101 → 3
5 2124, 2403, 3134

1234 → 2404 → 4103 → 2323 → 1234

2324 → 2434 → 4414 → 11034 → 2324

3444 → 11344 → 4340 → 4333 → 3444

6
7
8 20, 21, 400, 401, 420, 421
9 432, 2466
5 3 1020, 1021, 2102, 10121
4 200

3 → 3303 → 23121 → 10311 → 3312 → 20013 → 10110 → 3

3311 → 13220 → 10310 → 3311

Extension to negative integers

Perfect digital invariants can be extended to the negative integers by use of a signed-digit representation to represent each integer.

Balanced ternary

In balanced ternary, the digits are 1, −1 and 0. This results in the following:

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. This can be used to find happy numbers.

defpdif(x:int,p:int,b:int)->int:"""Perfect digital invariant function."""total=0whilex>0:total=total+pow(x%b,p)x=x//breturntotaldefpdif_cycle(x:int,p:int,b:int)->list[int]:seen=[]whilexnotinseen:seen.append(x)x=pdif(x,p,b)cycle=[]whilexnotincycle:cycle.append(x)x=pdif(x,p,b)returncycle

See also

Related Research Articles

<span class="mw-page-title-main">Chinese remainder theorem</span> Theorem for solving simultaneous congruences

In mathematics, the Chinese remainder theorem states that if one knows the remainders of the Euclidean division of an integer n by several integers, then one can determine uniquely the remainder of the division of n by the product of these integers, under the condition that the divisors are pairwise coprime.

<span class="mw-page-title-main">Quadratic reciprocity</span> Gives conditions for the solvability of quadratic equations modulo prime numbers

In number theory, the law of quadratic reciprocity is a theorem about modular arithmetic that gives conditions for the solvability of quadratic equations modulo prime numbers. Due to its subtlety, it has many formulations, but the most standard statement is:

In mathematics, a natural number in a given number base is a -Kaprekar number if the representation of its square in that base can be split into two parts, where the second part has digits, that add up to the original number. For example, in base 10, 45 is a 2-Kaprekar number, because 45² = 2025, and 20 + 25 = 45. The numbers are named after D. R. Kaprekar.

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 , and . On the other hand, 4 is not a happy number because the sequence starting with and eventually reaches , the number that started the sequence, and so the process continues in an infinite cycle without ever reaching 1. A number which is not happy is called sad or unhappy.

A divisibility rule is a shorthand and useful way of determining whether a given integer is divisible by a fixed divisor without performing the division, usually by examining its digits. Although there are divisibility tests for numbers in any radix, or base, and they are all different, this article presents rules and examples only for decimal, or base 10, numbers. Martin Gardner explained and popularized these rules in his September 1962 "Mathematical Games" column in Scientific American.

In mathematics, the Leibniz formula for π, named after Gottfried Wilhelm Leibniz, states that

<span class="mw-page-title-main">Schönhage–Strassen algorithm</span> Multiplication algorithm

The Schönhage–Strassen algorithm is an asymptotically fast multiplication algorithm for large integers, published by Arnold Schönhage and Volker Strassen in 1971. It works by recursively applying fast Fourier transform (FFT) over the integers modulo 2n+1. The run-time bit complexity to multiply two n-digit numbers using the algorithm is in big O notation.

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 would be

In mathematics, Hensel's lemma, also known as Hensel's lifting lemma, named after Kurt Hensel, is a result in modular arithmetic, stating that if a univariate polynomial has a simple root modulo a prime number p, then this root can be lifted to a unique root modulo any higher power of p. More generally, if a polynomial factors modulo p into two coprime polynomials, this factorization can be lifted to a factorization modulo any higher power of p.

In number theory, a Dudeney number in a given number base 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 noted the existence of these numbers in one of his puzzles, Root Extraction, where a professor in retirement at Colney Hatch postulates this as a general method for root extraction.

In mathematics, a Kloosterman sum is a particular kind of exponential sum. They are named for the Dutch mathematician Hendrik Kloosterman, who introduced them in 1926 when he adapted the Hardy–Littlewood circle method to tackle a problem involving positive definite diagonal quadratic forms in four as opposed to five or more variables, which he had dealt with in his dissertation in 1924.

In number theory, a narcissistic number in a given number base is a number that is the sum of its own digits each raised to the power of the number of digits.

A sum-product number in a given number base is a natural number that is equal to the product of the sum of its digits and the product of its digits.

In mathematics, a Witt vector is an infinite sequence of elements of a commutative ring. Ernst Witt showed how to put a ring structure on the set of Witt vectors, in such a way that the ring of Witt vectors over the finite field of order is isomorphic to , the ring of -adic integers. They have a highly non-intuitive structure upon first glance because their additive and multiplicative structure depends on an infinite set of recursive formulas which do not behave like addition and multiplication formulas for standard p-adic integers.

The digital root of a natural number in a given radix is the value obtained by an iterative process of summing digits, on each iteration using the result from the previous iteration to compute a digit sum. The process continues until a single-digit number is reached. For example, in base 10, the digital root of the number 12345 is 6 because the sum of the digits in the number is 1 + 2 + 3 + 4 + 5 = 15, then the addition process is repeated again for the resulting number 15, so that the sum of 1 + 5 equals 6, which is the digital root of that number. In base 10, this is equivalent to taking the remainder upon division by 9, which allows it to be used as a divisibility rule.

In number theory, the multiplicative digital root of a natural number in a given number base is found by multiplying the digits of together, then repeating this operation until only a single-digit remains, which is called the multiplicative digital root of . The multiplicative digital root for the first few positive integers are:

In number theory, a factorion in a given number base 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.

In number theory, an aurifeuillean factorization, named after Léon-François-Antoine Aurifeuille, is factorization of certain integer values of the cyclotomic polynomials. Because cyclotomic polynomials are irreducible polynomials over the integers, such a factorization cannot come from an algebraic factorization of the polynomial. Nevertheless, certain families of integers coming from cyclotomic polynomials have factorizations given by formulas applying to the whole family, as in the examples below.

In number theory, a perfect digit-to-digit invariant is a natural number in a given number base that is equal to the sum of its digits each raised to the power of itself. An example in base 10 is 3435, because . 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 raising himself up by his own ponytail because each digit is raised to the power of itself.

In number theory and mathematical logic, a Meertens number in a given number base 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 the CWI, Amsterdam.

References

  1. 1 2 Perfect and PluPerfect Digital Invariants Archived 2007-10-10 at the Wayback Machine by Scott Moore
  2. PDIs by Harvey Heinz