OFFSET
1,2
COMMENTS
Where a(n) <> a(n-1)+n: 3, 6, 29, 116 and 348 and no others < 2*10^6. - Robert G. Wilson v, Jun 18 2004
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
a(29) = a(28)*29 = 493*29 = 14297 since 29 divides a(28) = 493 = 17*29.
MATHEMATICA
a[1] = 1; a[n_] := a[n] = If[Mod[a[n - 1], n] == 0, n*a[n - 1], a[n - 1] + n]
nxt[{n_, a_}]:={n+1, If[Divisible[a, n+1], a(n+1), a+n+1]}; NestList[nxt, {1, 1}, 50][[All, 2]] (* Harvey P. Dale, Jan 14 2017 *)
PROG
(PARI) m=44; print1(a=1, ", "); for(n=2, m, print1(a=if(a%n>0, n+a, n*a), ", ")) \\ Klaus Brockhaus, Jun 18 2004
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Amarnath Murthy, Jun 13 2004
EXTENSIONS
STATUS
approved