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.
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
Keywords
Programs
-
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
Extensions
More terms from Michel Marcus, Feb 10 2014
Comments