OFFSET
1,2
COMMENTS
Heuristics suggest that numbers n such that a(n) = -1 have density 1 and may be quite dense by 10^10. - Charles R Greathouse IV, Nov 15 2021
LINKS
Michel Marcus, Table of n, a(n) for n = 1..378
EXAMPLE
MATHEMATICA
f[n_] := Times @@ Accumulate @ IntegerDigits[n]; a[n_, itermax_] := Module[{m = FixedPoint[f, n, itermax]}, If[f[m] == m, m, 0]]; itermax = 100; Table[a[k, itermax], {k, 1, 100}] (* returns 0 if the number of iterations exceeds itermax, Amiram Eldar, Nov 12 2021 *)
PROG
(PARI) f(n) = my(d=digits(n)); prod(i=1, #d, sum(j=1, i, d[j])); \\ A349194
a(n) = {my(nb=0); while (1, my(m=f(n)); nb++; if (m==n, return (m)); if (nb > 100, return (0)); n = m; ); }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Marcus, Nov 12 2021
STATUS
approved