OFFSET
0,3
COMMENTS
The sequence is not monotonically increasing but has an increasing trend with some nodes i.e. numbers occurring twice in the sequence like 60 etc. Are there infinitely many nodes in the sequence.?
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
EXAMPLE
Since 12 divides a(11)=60, a(12) = 60 - 12 = 48.
Since 13 does not divide a(12)=48, a(13) = 48 + 13 = 61.
MATHEMATICA
nxt[{n_, a_}]:={n+1, Which[a==0, n+1, Divisible[a, n+1], a-(n+1), True, a+n+1]}; NestList[nxt, {0, 0}, 60][[All, 2]] (* Harvey P. Dale, Jun 29 2021 *)
PROG
(PARI) lista(nn) = {preca = 0; for (n=1, nn, print1(preca, ", "); if (preca == 0, nexta = n, if (preca % n, nexta = preca + n, nexta = preca - n); ); preca = nexta; ); } \\ Michel Marcus, Jan 23 2014
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Amarnath Murthy, Feb 26 2002
STATUS
approved