login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A348745
Bijection from primes to {1} U primes, a left inverse of A348744.
3
1, 2, 3, 7, 11, 5, 13, 19, 23, 17, 31, 29, 37, 43, 47, 41, 59, 53, 67, 71, 61, 79, 83, 73, 89, 97, 103, 107, 101, 109, 127, 131, 113, 139, 137, 151, 149, 163, 167, 157, 179, 173, 191, 181, 193, 199, 211, 223, 227, 197, 229, 239, 233, 251, 241, 263, 257, 271, 269, 277, 283, 281, 307, 311, 293, 313, 331, 317, 347, 337
OFFSET
1,2
PROG
(PARI)
up_to = 10000;
A348745list(up_to) = { my(lista=List([]), xs=Map(), i=2, p, q, u); mapput(xs, 3, 1); for(n=2, up_to, p = prime(n); if(1==(p%4), for(k=1+n, oo, q=prime(k); if((1==(q%4))&&!mapisdefined(xs, q), break)), while(mapisdefined(xs, prime(i)), i++); q = prime(i)); mapput(xs, q, n)); listput(lista, 1); for(i=2, oo, if(!mapisdefined(xs, prime(i), &u), return(Vec(lista)), listput(lista, prime(u)))); };
v348745 = A348745list(up_to);
A348745(n) = v348745[n];
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 02 2021
STATUS
approved