Dudeney_number

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 times 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,[1] 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 (sequence A061209 in the OEIS):

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

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 Fp,b for specific p and b

All numbers are represented in base .

More information , ...

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(x: int, p: int, b: int) -> int:
    """Dudeney function."""
    y = pow(x, p)
    total = 0
    while y > 0:
        total = total + y % b
        y = y // b
    return total

def dudeneyf_cycle(x: int, p: int, b: int) -> List:
    seen = []
    while x not in seen:
        seen.append(x)
        x = dudeneyf(x, p, b)
    cycle = []
    while x not in cycle:
        cycle.append(x)
        x = dudeneyf(x, p, b)
    return cycle

See also


References

  1. "Generalized Dudeney Numbers".
  • H. E. Dudeney, 536 Puzzles & Curious Problems, Souvenir Press, London, 1968, p 36, #120.

Share this article:

This article uses material from the Wikipedia article Dudeney_number, and is written by contributors. Text is available under a CC BY-SA 4.0 International License; additional terms may apply. Images, videos and audio are available under their respective licenses.