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
.
[Proof that number of sum-product numbers in any base is finite](_blank)
''PlanetMath''. by Raymond Puzio In base 10, there are exactly four sum-product numbers : 0, 1, 135, and 144.
Definition
Let
be a natural number. We define the sum-product function for base
to be the following:
:
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 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.
For example, the number 144 in
base 10
The decimal numeral system (also called the base-ten positional numeral system and denary or decanary) is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers of the Hindu–Arabic numeral ...
is a sum-product number, because
,
, and
.
A natural number
is a sociable sum-product number 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 ...
for
, where
for a positive integer
, and forms a
cycle
Cycle, cycles, or cyclic may refer to:
Anthropology and social sciences
* Cyclic history, a theory of history
* Cyclical theory, a theory of American political history associated with Arthur Schlesinger, Sr.
* Social cycle, various cycles in soc ...
of period
. A sum-product number is a sociable sum-product number with
, and a amicable sum-product number is a sociable sum-product number with
.
All natural numbers
are
preperiodic points for
, regardless of the base. This is because for any given digit count
, the minimum possible value of
is
and the maximum possible value of
is
. The maximum possible digit sum is therefore
and the maximum possible digit product is
. Thus, the sum-product function value is
. This suggests that
, or dividing both sides by
,
. Since
, this means that there will be a maximum value
where
, because of the
exponential nature of
and the
linearity
Linearity is the property of a mathematical relationship ('' function'') that can be graphically represented as a straight line. Linearity is closely related to '' proportionality''. Examples in physics include rectilinear motion, the linear ...
of
. Beyond this value
,
always. Thus, there are a finite number of sum-product numbers,
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 mathematics, a harshad number (or Niven number) in a given number base is an integer that is divisible by the sum of its digits when written in that base.
Harshad numbers in base are also known as -harshad (or -Niven) numbers.
Harshad numbe ...
in that base.
Sum-product numbers and cycles of ''F''''b'' for specific ''b''
All numbers are represented in base
.
Extension to negative integers
Sum-product numbers 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.
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.
def sum_product(x: int, b: int) -> int:
"""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
return sum_x * product
def sum_product_cycle(x: int, b: int) -> list nt
seen = []
while x not in seen:
seen.append(x)
x = sum_product(x, b)
cycle = []
while x not in cycle:
cycle.append(x)
x = sum_product(x, 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, ...
*
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
*
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 ...
*
Meertens number
*
Narcissistic number
*
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, be ...
*
Perfect digital invariant In number theory, a perfect digital invariant (PDI) is a number in a given number base (b) that is the sum of its own digits each raised to a given power (p). 0 F_ : \mathbb \rightarrow \mathbb is defined as:
:F_(n) = \sum_^ d_i^p.
where k = \lfl ...
References
{{Classes of natural numbers
Arithmetic dynamics
Base-dependent integer sequences