A sum-product number in a given
number base
In a positional numeral system, the radix or base is the number of unique digits, including the digit zero, used to represent numbers. For example, for the decimal/denary system (the most common system in use today) the radix (base number) is t ...
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 numer ...
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 a ...
for
, where
for a positive integer
, and forms a
cycle 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
Exponential may refer to any of several mathematical topics related to exponentiation, including:
*Exponential function, also:
**Matrix exponential, the matrix analogue to the above
*Exponential decay, decrease at a rate proportional to value
*Expo ...
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 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
Python may refer to:
Snakes
* Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia
** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia
* Python (mythology), a mythical serpent
Computing
* Python (pro ...
.
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
*
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
In number theory, Kaprekar's routine is an iterative algorithm that, with each iteration, takes a natural number in a given number base, creates two new numbers by sorting the digits of its number by descending and ascending order, and subtracts th ...
*
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 n ...
*
Meertens number
*
Narcissistic number
In number theory, a narcissistic number 1 F_ : \mathbb \rightarrow \mathbb to be the following:
: F_(n) = \sum_^ d_i^k.
where k = \lfloor \log_ \rfloor + 1 is the number of digits in the number in base b, and
: d_i = \frac
is the value of each d ...
*
Perfect digit-to-digit invariant
*
Perfect digital invariant
References
{{Classes of natural numbers
Arithmetic dynamics
Base-dependent integer sequences