login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A332211 Lexicographically earliest permutation of primes such that a(n) = 2^n - 1 when n is one of the Mersenne prime exponents (in A000043). 8
2, 3, 7, 5, 31, 11, 127, 13, 17, 19, 23, 29, 8191, 37, 41, 43, 131071, 47, 524287, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 2147483647, 103, 107, 109, 113, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 2305843009213693951, 269, 271, 277, 281, 283, 293, 307, 311, 313 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Sequence is well-defined also in case there are only a finite number of Mersenne primes.
LINKS
FORMULA
For all applicable n >= 1, a(A000043(n)) = A000668(n).
EXAMPLE
For p in A000043: 2, 3, 5, 7, 13, 17, 19, ..., a(p) = (2^p)-1, thus a(2) = 2^2 - 1 = 3, a(3) = 7, a(5) = 31, a(7) = 127, a(13) = 8191, a(17) = 131071, etc., with the rest of positions filled by the least unused prime:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ...
2, 3, 7, 5, 31, 11, 127, 13, 17, 19, 23, 29, 8191, 37, 41, 43, 131071, ...
PROG
(PARI)
up_to = 127;
A332211list(up_to) = { my(v=vector(up_to), xs=Map(), i=1, q); for(n=1, up_to, if(isprime(q=((2^n)-1)), v[n] = q, while(mapisdefined(xs, prime(i)), i++); v[n] = prime(i)); mapput(xs, v[n], n)); (v); };
v332211 = A332211list(up_to);
A332211(n) = v332211[n];
\\ For faster computing of larger values, use precomputed values of A000043:
v000043 = [2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217];
up_to = v000043[#v000043];
A332211list(up_to) = { my(v=vector(up_to), xs=Map(), i=1, q); for(n=1, up_to, if(vecsearch(v000043, n), q = (2^n)-1, while(mapisdefined(xs, prime(i)), i++); q = prime(i)); v[n] = q; mapput(xs, q, n)); (v); };
CROSSREFS
Cf. A000040, A000043, A000668, A332210 (inverse permutation of primes), A332220.
Used to construct permutations A332212, A332214.
Sequence in context: A085399 A063696 A258126 * A353075 A069587 A059843
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 09 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 12:27 EDT 2024. Contains 371969 sequences. (Running on oeis4.)