OFFSET
1,2
COMMENTS
A097029 is the subsequence of integers that are fixed points of one iteration.
Up to 10^9, one can find cycles of length: 1, 2, 3, 4, 5, 6, 8, 10, 12, 20.
LINKS
Michel Marcus, Table of n, a(n) for n = 1..178
Michel Marcus, Cycles up to 10^7
PROG
(PARI) iscycle(v, nextn) = for (i=1, #v, if (v[i] == nextn, return (1); ); ); return (0);
fcycle(n, known) = {v = vector(1); v[1] = n; first = n; while ((nextn = eulerphi(n) + n\2) <= first, if (vecsearch(known, nextn), return([])); if (iscycle(v, nextn), return (v)); v = concat(v, nextn); n = nextn; ); return ([]); }
lista(nn) = {known = []; for (n = 1, nn, v = fcycle(n, known); if (#v, known = vecsort(concat(known, v))); ); print(known); } \\ corrected by Michel Marcus, Mar 15 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Jan 05 2017
STATUS
approved