login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Permutation of primes, inverse of A332211.
4

%I #17 Jul 13 2022 21:58:46

%S 2,3,7,5,13,19,23,29,31,37,11,43,47,53,61,71,73,79,83,89,97,101,103,

%T 107,109,113,131,137,139,149,17,151,157,163,167,173,179,181,191,193,

%U 197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383

%N Permutation of primes, inverse of A332211.

%C Sequence is well-defined also in case there are only a finite number of Mersenne primes.

%H Antti Karttunen, <a href="/A332210/b332210.txt">Table of n, a(n) for n = 1..86222</a>

%F For all applicable n >= 1, a(A059305(n)) = a(A000720(A000668(n))) = A000040(A000043(n)).

%o (PARI)

%o up_to = 127;

%o A332210list(up_to) = { my(lista=List([]), xs=Map(), i=1, q, u); for(n=1,up_to, if(!isprime(q=((2^n)-1)), while(mapisdefined(xs,prime(i)), i++); q = prime(i)); mapput(xs,q,n)); for(i=1,oo,if(!mapisdefined(xs,prime(i),&u),return(Vec(lista)),listput(lista,prime(u)))); };

%o \\ For computing a larger number of terms, use the precomputed values of A000043:

%o v000043 = [2,3,5,7,13,17,19,31,61,89,107,127,521,607,1279, 2203,2281,3217,4253,4423,9689,9941,11213,19937, 21701,23209,44497,86243,110503,132049,216091, 756839,859433,1257787,1398269,2976221,3021377, 6972593,13466917,20996011,24036583,25964951, 30402457,32582657,37156667,42643801,43112609];

%o A332210list(up_to) = { my(lista=List([]), xs=Map(), m000043 = Map(), i=1, q, u); for(k=1,#v000043,mapput(m000043,v000043[k],k)); for(n=1,min(up_to,v000043[#v000043]), if(mapisdefined(m000043,n), q = (2^n)-1, while(mapisdefined(xs,prime(i)), i++); q = prime(i)); mapput(xs,q,n)); for(i=1,oo,if(!mapisdefined(xs,prime(i),&u),return(Vec(lista)),listput(lista,prime(u)))); };

%o v332210 = A332210list(up_to);

%o A332210(n) = v332210[n];

%Y Cf. A000040, A000043, A000668, A000720, A059305, A332211, A332220.

%Y Used to construct permutations A332213, A332215.

%K nonn

%O 1,1

%A _Antti Karttunen_, Feb 09 2020