OFFSET
1,1
COMMENTS
Maximum value in the first 10^5 terms is a(6874) = 209875, from b(128) on.
First n's whose last repetitive number of the sequence b(k) is a multiple: 1, 2, 5, 6, 34, 42, 135, 195, 460, 893, 2370, 4230, 7165, 237945.
LINKS
Paolo P. Lava, Table of n, a(n) for n = 1..10000
EXAMPLE
b(1) = 1, b(2) = 7. Then:
b(3) = 7 + Pd(1) = 7+1 = 8; b(4) = 8 + Pd(7) = 8+7 = 15;
b(5) = 15 + Pd(8) = 15+8 = 23; b(6) = 23 + Pd(15) = 23+5 = 28;
b(7) = 28 + Pd(23) = 28+6 = 34; b(8) = 34 + Pd(28) = 34+16 = 50;
…
b(19) = 270 + Pd(214) = 270+8 = 278; b(20) = 278 + Pd(270) = 278+0 = 278;
b(21) = 278 + Pd(278) = 278+112 = 390; b(22) = 390 + Pd(278) = 390+112 = 502;
b(23) = 502 + Pd(502) = 502+0 = 502; therefore a(7) = 502.
MAPLE
with(numtheory); T:=proc(w) local x, y, z; x:=w; y:=1;
for z from 1 to ilog10(x)+1 do y:=y*(x mod 10); x:=trunc(x/10); od; y; end:
P:=proc(q) local a1, a2, a3, n; for n from 1 to q do a1:=1; a2:=n; a3:=T(a1)+a2;
while not (a1=a2 and a2=a3) do a1:=a2; a2:=a3; a3:=T(a1)+a2; od; print(a1);
od; end: P(10^7);
MATHEMATICA
a[n_] := Block[{b=0, c=1, d=n, p}, While[! (b == c == d), b=c; p = Times @@ IntegerDigits@ c; c = d; d += p]; d]; Array[a, 50] (* Giovanni Resta, Jun 20 2016 *)
PROG
(PARI) pd(n) = my(d=digits(n)); prod(k=1, #d, d[k]);
a(n) = {ba = 1; bb = n; bc = bb + pd(ba); while (!((ba ==bb) && (bc == bb)), newb = bb + pd(ba); ba = bb; bb = bc; bc = bb + pd(ba); ); bc; } \\ Michel Marcus, Jun 20 2016
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Paolo P. Lava, Jun 17 2016
STATUS
approved