A235031 The first integer that produces a sequence of n terms without repetition. Any term of the sequence, after the first one, is the sum of PD and SD of the previous term of the sequence. PD is the product of the nonzero digits; SD is the sum of the digits.
2, 1, 26, 28, 66, 289, 579, 3468, 23889, 2366688, 45579999, 356688888888, 35888888888888889, 2455566666777777999999999999999
Offset: 17
Examples
For n=18: 1, 2, 4, 8, 16, 13, 7, 14, 9, 18, 17, 15, 11, 3, 6, 12, 5, 10. For n=19: 26, 20, 4, 8, 16, 13, 7, 14, 9, 18, 17, 15, 11, 3, 6, 12, 5, 10, 2.
Programs
-
PARI
step(n)=my(d=digits(n),D=select(k->k>1,d)); sum(i=1,#d, d[i]) + prod(i=1,#D, D[i]) len(n)=my(v=Set([n])); while(1,n=step(n); if(setsearch(v,n), return(#v)); v=setunion(v,Set([n]))) a(n)=my(k);while(len(k++)!=n,); k \\ Charles R Greathouse IV, Jan 02 2014
Extensions
a(17) and a(27)-a(30) from Giovanni Resta, Jan 02 2014
Comments