OFFSET
1,2
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10010
FORMULA
Apparently, a(n) = n iff n belongs to A000217. - Rémy Sigrist, May 16 2021
MATHEMATICA
RecurrenceTable[{a[n + 1] == If[Divisible[a[n], n + 1], n + 1, a[n] + n + 1], a[1] == 1}, a, {n, 1, 100}]
PROG
(PARI) lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, va[n] = va[n-1]; if (va[n-1] % n, va[n] += n, va[n]); ); va; } \\ Michel Marcus, May 17 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Harvey L. Devereux, Apr 27 2021
STATUS
approved