OFFSET
1,1
COMMENTS
EXAMPLE
256 -> 3600 -> 324 -> 576 -> 44100 -> 256 is a limit cycle of f, so all elements are terms.
PROG
(Python)
from math import prod
from itertools import count, islice
def f(n): return prod(int(d)**2 for d in str(n) if d != "0")
def ok(n):
n0, k, seen = n, 0, set(),
while n not in seen: # iterate until fixed point or in cycle
seen.add(n)
n = f(n)
k += 1
return n == n0 and k > 1
def agen(startk=1):
for m in count(1):
if ok(m): yield m
print(list(islice(agen(), 11)))
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Michael S. Branicky, Mar 24 2022
STATUS
approved