login
A332805
a(n) = A000720(A332806(n)).
3
1, 2, 3, 4, 6, 5, 7, 8, 10, 9, 12, 11, 13, 14, 16, 15, 18, 17, 20, 22, 19, 24, 26, 21, 23, 25, 28, 30, 27, 29, 32, 34, 31, 36, 33, 38, 35, 40, 42, 37, 44, 39, 46, 41, 43, 48, 50, 52, 54, 45, 47, 56, 49, 58, 51, 60, 53, 62, 55, 57, 64, 59, 66, 68, 61, 63, 70, 65, 72, 67, 69, 74, 76, 71, 78, 80, 73, 75, 77, 79, 82, 81, 84, 83, 86, 88, 85
OFFSET
1,2
FORMULA
For all n >= 1, A108546(a(n)) = A000040(n).
PROG
(PARI)
up_to = 10000;
A332805list(up_to) = { my(v=vector(2), xs=Map(), lista=List([]), p, q); 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, u))); };
v332805 = A332805list(up_to);
A332805(n) = v332805[n];
CROSSREFS
Cf. A000040, A108546, A332806, A332807 (inverse permutation).
Fixed points are given by A000720(A108547(n)), n>=1.
Cf. also A267100.
Sequence in context: A371425 A361940 A361926 * A332807 A373038 A267106
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 27 2020
STATUS
approved