b
There are a finite number of sum-product numbers in any given base
b
Let
n
b>1
Fb:N → N
Fb(n)=
k | |
\left(\sum | |
i=1 |
di\right)\left(\prod
k | |
j=1 |
dj\right)
k=\lfloorlogb{n}\rfloor+1
b
di=
n\bmod{bi+1 | |
- |
n\bmodbi}{bi}
n
Fb
Fb(n)=n
b
For example, the number 144 in base 10 is a sum-product number, because
1+4+4=9
1 x 4 x 4=16
9 x 16=144
A natural number
n
Fb
p(n) | |
F | |
b |
=n
p
p
p=1
p=2.
All natural numbers
n
Fb
k
n
bk-1
n
bk-1=
k-1 | |
\sum | |
i=0 |
(b-1)k.
k(b-1)
(b-1)k.
Fb(n)=k(b-1)k+1.
k(b-1)k+1\geqn\geqbk-1,
(b-1)k-1
k(b-1)2\geq{\left(
b | |
b-1 |
\right)}k-1.
b | |
b-1 |
\geq1,
k
{\left( | b |
b-1 |
\right)}k\leqk(b-1)2,
{\left( | b |
b-1 |
\right)}k
k(b-1)2.
k
Fb(n)\leqn
bk-1,
The number of iterations
i
i(n) | |
F | |
b |
n
Any integer shown to be a sum-product number in a given base must, by definition, also be a Harshad number in that base.
All numbers are represented in base
b
Base | Nontrivial sum-product numbers | Cycles | |
---|---|---|---|
(none) | (none) | ||
(none) | 2 → 11 → 2, 22 → 121 → 22 | ||
12 | (none) | ||
341 | 22 → 31 → 22 | ||
(none) | (none) | ||
22, 242, 1254, 2343, 116655, 346236, 424644 | |||
(none) | |||
13, 281876, 724856, 7487248 | 53 → 143 → 116 → 53 | ||
135, 144 | |||
253, 419, 2189, 7634, 82974 | |||
128, 173, 353 | |||
435, A644, 268956 | |||
328, 544, 818C | |||
2585 | |||
14 | |||
33, 3B2, 3993, 3E1E, C34D, C8A2 | |||
175, 2D2, 4B2 | |||
873, B1E, 24A8, EAH1, 1A78A, 6EC4B7 | |||
1D3, 14C9C, 22DCCG | |||
1CC69 | |||
24, 366C, 6L1E, 4796G | |||
7D2, J92, 25EH6 | |||
33DC | |||
15, BD75, 1BBN8A | |||
81M, JN44, 2C88G, EH888 | |||
\varnothing | |||
15B | |||
\varnothing | |||
976, 85MDA | |||
44, 13H, 1E5 | |||
\varnothing | |||
1KS69, 54HSA | |||
25Q8, 16L6W, B6CBQ | |||
4U5W5 | |||
16, 22O |
Sum-product numbers can be extended to the negative integers by use of a signed-digit representation to represent each integer.
The example below implements the sum-product function described in the definition above to search for numbers and cycles in Python.
def sum_product_cycle(x: int, b: int) -> list[int]: 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