OFFSET
1,1
COMMENTS
This is a permutation of the positive integers excluding 1 and 6.
PROG
(PARI) ispp(n) = (n==1) || isprimepower(n);
lista(nn) = {vn = vector(nn, i, i); vpp = select(n->ispp(n), vn); vnpp = select(n->(!ispp(n)), vn); vr = vector(nn); for (i=1, #vpp-1, vr[vpp[i]] = vpp[i+1]; ); for (i=1, #vnpp-1, vr[vnpp[i]] = vnpp[i+1]; ); for (i=1, nn, if (vr[i], print1(vr[i], ", "), return()); ); } \\ Michel Marcus, Feb 10 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Apr 30 2008
EXTENSIONS
More terms from Michel Marcus, Feb 10 2014
STATUS
approved