|
|
|
|
0, 102, 110, 140, 150, 170, 209, 210, 260, 330, 4506, 11620, 17054, 19008, 20979, 24120, 27780, 32305, 32805, 34590, 42012, 52054, 55048, 59049, 65610, 70536, 75006, 90432, 111006, 112050, 118098, 120594, 136052, 150297, 153302, 160824, 181039, 183708, 208044
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
PROG
|
(Python)
import numpy
input_list = []
output_list = []
max_list = []
range_ = 10 ** 7
lower = 0
upper = lower + range_
for i in range(lower, upper):
input_list.append(i)
number = str(i)
results_list = []
total = 0
total_list = []
while True:
number_list = []
for x in list(number):
number_list.append(int(x))
results_list.append(numpy.prod(number_list))
total += numpy.prod(number_list)
if total in total_list:
output_list.append(total_list[-1])
if total_list[-1] >= max(output_list):
if total_list[-1] not in max_list:
max_list.append(total_list[-1])
break
total_list.append(total)
number = str(total)
print(max_list)
(Python)
from math import prod
from itertools import count, islice
def pd(n): return prod(map(int, str(n)))
def f(x): return x + pd(x)
def agen(): # generator of terms
record, seen = -1, set()
for n in count(0):
x = pd(n)
if x in seen: continue
seen.add(x)
fx = f(x)
while x != fx: x, fx = fx, f(fx)
if fx > record:
record = fx
yield record
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|