login
A137929
If n = the k-th prime power (including 1), then a(n) = the (k+1)th prime power. If n = the k-th positive integer that is not a prime power, then a(n) = the (k+1)th positive integer that is not a prime power.
1
2, 3, 4, 5, 7, 10, 8, 9, 11, 12, 13, 14, 16, 15, 18, 17, 19, 20, 23, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 33, 32, 37, 34, 35, 36, 38, 41, 39, 40, 42, 43, 44, 47, 45, 46, 48, 49, 50, 53, 51, 52, 54, 59, 55, 56, 57, 58, 60, 61, 62, 64, 63, 65, 67, 66, 68, 71
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
Sequence in context: A272072 A118463 A214652 * A094617 A254318 A047502
KEYWORD
nonn
AUTHOR
Leroy Quet, Apr 30 2008
EXTENSIONS
More terms from Michel Marcus, Feb 10 2014
STATUS
approved