login
Bijection from primes to {1} U primes, a left inverse of A348744.
3

%I #4 Nov 02 2021 20:59:36

%S 1,2,3,7,11,5,13,19,23,17,31,29,37,43,47,41,59,53,67,71,61,79,83,73,

%T 89,97,103,107,101,109,127,131,113,139,137,151,149,163,167,157,179,

%U 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

%N Bijection from primes to {1} U primes, a left inverse of A348744.

%o (PARI)

%o up_to = 10000;

%o 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)))); };

%o v348745 = A348745list(up_to);

%o A348745(n) = v348745[n];

%Y Cf. A002144, A002145, A348744, A348747.

%K nonn

%O 1,2

%A _Antti Karttunen_, Nov 02 2021