A161185 First column of a table of all primes sorted by recursive look-up depending on the primality of their indices.
2, 3, 7, 11, 17, 19, 29, 31, 37, 41, 43, 47, 53, 67, 71, 73, 79, 83, 89, 97, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 181, 191, 193, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 271, 277, 281, 283, 293, 307, 311, 313, 317, 337, 347, 349
Offset: 1
Examples
The table with the generator in the first column and followup primes in the same row starts: 2,5,23,431,3821,... 3,13,179,1439,... 7,59,419,... 11,61,1847,... 17,101,3943,... 19,331,2833,... 29,599,5507,... 31,197,9739,... 37,919,8861,... 41,269,... 43,1153,... 47,1297,...
Crossrefs
Cf. A141436.
Programs
-
PARI
lista(nn) = my(v = primes(nn), vp = select(x->isprime(primepi(x)), v), vc = setminus(v, vp), list = List()); while (#v, my(p=v[1], q); listput(list, p); v = setminus(v, [p]); my(ok = 1); while(ok, if (vecsearch(vp, p), vx=vc; vy=vp, vx=vp; vy=vc); if (p > #vx, ok = 0, q = vx[p]; v = setminus(v, [q]); if (q > #vy, ok = 0, q = vy[q]; v = setminus(v, [q]); p = q;);););); Vec(list); \\ Michel Marcus, Oct 31 2022
Extensions
Edited and extended by R. J. Mathar, Jun 23 2009
More terms from Michel Marcus, Oct 31 2022
Comments