OFFSET
1,2
COMMENTS
LINKS
PROG
(PARI) already(val, v, nb)=for (i = 1, nb, if (val == v[i], return (1)); ); return (0);
lista(nn) = {preca = 0; vm = vector(nn); for (n=1, nn, vm[n] = preca; if (preca == 0, nexta = n, if (preca % n, nexta = preca + n, nexta = preca - n); ); if (already(preca, vm, n-1), print1(preca, ", ")); preca = nexta; ); } \\ Michel Marcus, Jan 23 2014
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Amarnath Murthy, Feb 26 2002
EXTENSIONS
Name and comments edited by Michel Marcus, Jan 23 2014
Offset changed to 1 and more terms from Michel Marcus, Jan 23 2014
STATUS
approved