Professional Documents
Culture Documents
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.
There are a finite number of sum-product numbers in any given base .[1] In base 10, there are exactly four
sum-product numbers (sequence A038369 in the OEIS): 0, 1, 135, and 144.[2]
Contents
Definition
Sum-product numbers and cycles of Fb for specific b
Extension to negative integers
Programming example
See also
References
Definition
Let be a natural number. We define the sum-product function for base to be the
following:
is the value of each digit of the number. A natural number is a sum-product number if it is a fixed point
for , which occurs if . The natural numbers 0 and 1 are trivial sum-product numbers for all
, and all other sum-product numbers are nontrivial sum-product numbers.
. The maximum possible digit sum is therefore and the maximum possible
always. Thus, there are a finite number of sum-product numbers,[1] and any natural number is guaranteed
to reach a periodic point or a fixed point less than , making it a preperiodic point.
The number of iterations needed for to reach a fixed point is the sum-product function's
persistence of , and undefined if it never reaches a fixed point.
Any integer shown to be a sum-product number in a given base must, by definition, also be a Harshad
number in that base.
Programming example
The example below implements the sum-product function described in the definition above to search for
sum-product numbers and cycles in Python.
"""Sum-product number."""
sum_x = 0
product = 1
while x > 0:
if x % b > 0:
sum_x = sum_x + x % b
product = product * (x % b)
x = x // b
seen = []
seen.append(x)
x = sum_product(x, b)
cycle = []
cycle.append(x)
x = sum_product(x, b)
return cycle
See also
Arithmetic dynamics
Dudeney number
Factorion
Happy number
Kaprekar's constant
Kaprekar number
Meertens number
Narcissistic number
Perfect digit-to-digit invariant
Perfect digital invariant
References
1. Proof that number of sum-product numbers in any base is finite (https://web.archive.org/web/
20130509195412/http://planetmath.org/proofthatnumberofsumproductnumbersinanybaseisfi
nite), PlanetMath. Archived (https://web.archive.org/web/20130509195412/http://planetmath.
org/proofthatnumberofsumproductnumbersinanybaseisfinite) 2013-05-09 at the Wayback
Machine by Raymond Puzio
2. Sloane, N. J. A. (ed.). "Sequence A038369 (Numbers n such that n = (product of digits of n) *
(sum of digits of n).)" (https://oeis.org/A038369). The On-Line Encyclopedia of Integer
Sequences. OEIS Foundation.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Sum-product_number&oldid=1046162476"