|
|
A337789
|
|
Numbers k such that trajectory of k under repeated calculation of fecundity (x -> A070562(x)) eventually reaches 0.
|
|
1
|
|
|
0, 1, 5, 10, 15, 18, 20, 21, 22, 24, 27, 30, 35, 40, 42, 44, 46, 48, 50, 51, 55, 59, 60, 63, 64, 66, 67, 69, 70, 74, 75, 77, 80, 83, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 115, 118, 120, 121, 122, 124, 127
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
EXAMPLE
|
5 is a term in the sequence because the fecundity of 5 is 1, the fecundity of 1 is 10 and the fecundity of 10 is 0.
7 is not a term in the sequence because the fecundity of 7 is 7 and therefore the fecundity will never become 0.
|
|
MAPLE
|
fec:= proc(n) local k, x, t;
x:= n;
for k from 0 do
t:= convert(convert(x, base, 10), `*`);
if t = 0 then return k fi;
x:= x+t
od
end proc:
filter:= proc(n) local v; option remember;
v:= fec(n);
if v = 0 then true
elif v = n then false
else procname(v)
fi
end proc:
|
|
MATHEMATICA
|
fec[n_] := Length @ FixedPointList[# + Times @@ IntegerDigits[#] &, n] - 2; Select[Range[0, 100], FixedPoint[fec, #] == 0 &] (* Amiram Eldar, Sep 22 2020 *)
|
|
PROG
|
(Python)
from math import prod
from functools import lru_cache
def pd(n): return prod(map(int, str(n)))
s = 0
while pd(n) != 0: n, s = n + pd(n), s + 1
return s
@lru_cache(maxsize=None)
def ok(n):
if fn == 0: return True
if fn == n: return False
return ok(fn)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|