login
A343752
a(1) = 1; for n > 1, a(n) = n if a(n-1) is divisible by n, otherwise a(n) = a(n-1)+n.
1
1, 3, 3, 7, 12, 6, 13, 21, 30, 10, 21, 33, 46, 60, 15, 31, 48, 66, 85, 105, 21, 43, 66, 90, 115, 141, 168, 28, 57, 87, 118, 150, 183, 217, 252, 36, 73, 111, 150, 190, 231, 273, 316, 360, 45, 91, 138, 186, 235, 285, 336, 388, 441, 495, 55, 111, 168, 226
OFFSET
1,2
LINKS
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
Cf. A000217.
Sequence in context: A279475 A161815 A006661 * A068626 A126698 A219211
KEYWORD
nonn
AUTHOR
Harvey L. Devereux, Apr 27 2021
STATUS
approved