OFFSET
1,1
LINKS
%H P. A. Loomis, An Interesting Family of Iterated Sequences
%H P. A. Loomis, An Introduction to Digit Product Sequences, J. Rec. Math., 32 (2003-2004), 147-151.
%H P. A. Loomis, An Introduction to Digit Product Sequences, J. Rec. Math., 32 (2003-2004), 147-151. [Annotated archived copy]
EXAMPLE
21 is the unique k such that k + (product of nonzero digits of k) = 23, hence 23 is a term.
MATHEMATICA
f[n_] := Block[{s = Sort[ IntegerDigits[n]]}, While[ s[[1]] == 0, s = Drop[s, 1]]; n + Times @@ s]; t = Table[0, {200}]; Do[ a = f[n]; If[a < 200, t[[a]]++ ], {n, 200}]; Select[ Range[ 200], t[[ # ]] == 1 &] (* Robert G. Wilson v, Jul 16 2004 *)
PROG
(PARI) addpnd(n)=local(k, s, d); k=n; s=1; while(k>0, d=divrem(k, 10); k=d[1]; s=s*max(1, d[2])); n+s
{c=1; z=160; v=vector(z); for(n=1, z+1, k=addpnd(n); if(k<=z, v[k]=v[k]+1)); for(j=1, length(v), if(v[j]==c, print1(j, ", ")))}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Klaus Brockhaus, Jul 15 2004
STATUS
approved