cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A332806 Permutation of primes, inverse of A108546.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 27 2020

Keywords

Crossrefs

Differs from its inverse A108546 for the first time at n=19, where a(19) = 71, while A108546(19) = 73.

Programs

  • 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];

Formula

a(n) = A000040(A332805(n)).
a(A000720(A108547(n))) = A108547(n).