Dudeney number


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.

Mathematical definition

Let be a natural number. We define the Dudeney function for base and power to be the following:
where is the number of digits in the number in base.
A natural number is a Dudeney root if it is a fixed point for, which occurs if. The natural number is a generalised Dudeney number, and for, the numbers are known as Dudeney numbers. and are trivial Dudeney numbers for all and, all other trivial Dudeney numbers are nontrivial trivial Dudeney numbers.
For and, there are exactly six such integers :
A natural number is a sociable Dudeney root if it is a periodic point for, where for a positive integer, and forms a cycle of period. A Dudeney root is a sociable Dudeney root with, and a amicable Dudeney root is a sociable Dudeney root with. Sociable Dudeney numbers and amicable Dudeney numbers are the powers of their respective roots.
The number of iterations needed for to reach a fixed point is the Dudeney function's persistence of, and undefined if it never reaches a fixed point.
It can be shown that given a number base and power, the maximum Dudeney root has to satisfy this bound:
implying a finite number of Dudeney roots and Dudeney numbers for each order and base.
is the digit sum. The only Dudeney numbers are the single-digit numbers in base, and there are no periodic points with prime period greater than 1.

Dudeney numbers, roots, and cycles of ''F''''p'',''b'' for specific ''p'' and ''b''

All numbers are represented in base.
Nontrivial Dudeney rootsNontrivial Dudeney numbersCycles ofAmicable/Sociable Dudeney numbers
22
23211
24321
25431
26541
273, 4, 612, 22, 51
287612 → 4 → 24 → 20 → 4
29871
21098113 → 16 → 13169 → 256 → 169
2115, 6, A23, 33, 91
212BA19 → 13 → 14 → 1269 → 169 → 194 → 144
2134, 9, C, 1313, 63, B1, 169
214DC19 → 12 → 95B → 144 → 5B
2157, 8, E34, 44, D1
2 → 4 → 2
9 → B → 9

4 → 11 → 4
56 → 81 → 56
2166, A, F24, 64, E1
32
3311, 222101, 20022212 → 21 → 1211122 → 110201 → 11122
342, 12, 13, 21, 2220, 3120, 11113, 23121, 33220
353, 13, 14, 22, 23102, 4022, 10404, 23403, 3224212 → 21 → 122333 → 20311 → 2333
3613, 15, 23, 243213, 10055, 23343, 3054411 → 12 → 111331 → 2212 → 1331
372, 4, 11, 12, 14, 15, 21, 2211, 121, 1331, 2061, 3611, 5016, 12561, 1464125 → 34 → 2525666 → 63361 → 25666
386, 15, 16330, 4225, 527017 → 26 → 176457 → 24630 → 6457
393, 7, 16, 17, 2530, 421, 4560, 5551, 17618
5 → 14 → 5
12 → 21 → 12
18 → 27 → 18

148 → 3011 → 148
1738 → 6859 → 1738
6658 → 15625 → 6658
3108, 17, 18, 26, 27512, 4913, 5832, 17576, 1968319 → 28 → 196859 → 21952 → 6859
3115, 9, 13, 15, 18, 22, 25104, 603, 2075, 3094, 5176, A428, 13874
8 → 11 → 8
A → 19 → A
14 → 23 → 14
16 → 21 → 16

426 → 1331 → 426
82A → 6013 → 82A
2599 → 10815 → 2599
3767 → 12167 → 3767
31219, 1A, 1B, 28, 29, 2A5439, 61B4, 705B, 16B68, 18969, 1A8B4
8 → 15 → 16 → 11 → 8
13 → 18 → 21 → 14 → 13

368 → 2A15 → 3460 → 1331 → 368
1B53 → 4768 → 9061 → 2454 → 1B53
4211, 1011010001, 1001110001
431110011122 → 101 → 2212121201 → 111201101 → 12121201
443, 13, 21, 311101, 211201, 1212201, 12332101
454, 14, 22, 23, 312011, 202221, 1130421, 1403221, 4044121
4624, 32, 421223224, 3232424, 1344334414 → 23 → 14114144 → 1030213 → 114144
52110, 111, 10011111001100000, 100000110100111, 1110011010101001
531011200201120122 → 121 → 112 → 110 → 221122221122 → 1222021101011 → 1000022202102 → 110122100000 → 1122221122
542, 22200, 12012220021 → 33 → 102 → 30 → 2132122221 → 2321121033 → 13031110200 → 330300000 → 32122221
621101011011001000000111 → 1001 → 1010 → 11111100101110010001 → 10000001101111110001 → 11110100001001000000 → 11100101110010001
63101 → 112 → 121 → 1011212210202001 → 112011112120201 → 1011120101000101 → 1212210202001

Extension to negative integers

Dudeney numbers can be extended to the negative integers by use of a signed-digit representation to represent each integer.

Programming example

The example below implements the Dudeney function described in the definition above to search for Dudeney roots, numbers and cycles in Python.

def dudeneyf -> int:
"""Dudeney function."""
y = pow
total = 0
while y > 0:
total = total + y % b
y = y // b
return total
def dudeneyf_cycle -> List:
seen =
while x not in seen:
seen.append
x = dudeneyf
cycle =
while x not in cycle:
cycle.append
x = dudeneyf
return cycle