login
A332806
Permutation of primes, inverse of A108546.
6
2, 3, 5, 7, 13, 11, 17, 19, 29, 23, 37, 31, 41, 43, 53, 47, 61, 59, 71, 79, 67, 89, 101, 73, 83, 97, 107, 113, 103, 109, 131, 139, 127, 151, 137, 163, 149, 173, 181, 157, 193, 167, 199, 179, 191, 223, 229, 239, 251, 197, 211, 263, 227, 271, 233, 281, 241, 293, 257, 269, 311, 277, 317, 337, 283, 307, 349, 313, 359, 331, 347, 373, 383, 353
OFFSET
1,1
LINKS
FORMULA
a(n) = A000040(A332805(n)).
a(A000720(A108547(n))) = A108547(n).
PROG
(PARI)
up_to = 10000;
A332806list(up_to) = { my(v=vector(2), xs=Map(), lista=List([]), p, q, u); v[2] = 3; v[1] = 5; mapput(xs, 1, 1); mapput(xs, 2, 2); mapput(xs, 3, 3); for(n=4, up_to, p = v[2-(n%2)]; q = nextprime(1+p); while(q%4 != p%4, q=nextprime(1+q)); v[2-(n%2)] = q; mapput(xs, primepi(q), n)); for(i=1, oo, if(!mapisdefined(xs, i, &u), return(Vec(lista)), listput(lista, prime(u)))); };
v332806 = A332806list(up_to);
A332806(n) = v332806[n];
CROSSREFS
Differs from its inverse A108546 for the first time at n=19, where a(19) = 71, while A108546(19) = 73.
Sequence in context: A126055 A126054 A067836 * A108546 A065107 A338944
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 27 2020
STATUS
approved