The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A215888 Numbers k such that 2^k - 1 - Sum_{prime p<k} 2^p is prime. 1
2, 3, 4, 5, 6, 7, 8, 21, 25, 33, 40, 58, 158, 226, 240, 295, 465, 730, 1774, 2184, 2352, 3279, 4221, 6340, 6373, 6374, 17822, 18591, 19456, 24410, 32085, 64534 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
The primes of this form can be written with k binary digits, which are 0 in prime positions and 1 in all other positions. Here, "position p" means the digit with value 2^p (so the LSB is position 0). See A215891 for a variant where the rightmost bit is position 1.
LINKS
G. L. Honaker, Jr. and Chris Caldwell (Eds.), Prime curio for 5461.
EXAMPLE
k=2, 3 and 4 are in the sequence because 2^2 - 1 = 2^3 - 1 - 2^2 = 2^4 - 1 - 2^2 - 2^3 = 3 is prime. (For k=3 and k=4, since the uppermost digits are set to zero, one gets the same prime as for k=2 which is in fact only of binary length 2.)
k=5 and k=6 are in the sequence because 2^5 - 1 - 2^2 - 2^3 = 2^6 - 1 - 2^2 - 2^3 - 2^5 = 19 is prime. (For k=6, 2^5 cancels the uppermost bit so again we have only 5 binary digits.)
k=7 and k=8 are in the sequence because 2^7 - 1 - 2^2 - 2^3 - 2^5 = 2^8 - 1 - 2^2 - 2^3 - 2^5 - 2^7 = 83 is prime. (Here again, 2^7 cancels the uppermost bit so we have only 7 binary digits.) One can see that whenever a term a(n) of the sequence is the larger of a twin prime pair, then a(n+1) = a(n)+1 is also in the sequence and corresponds to the same a(n)-digit prime.
k=21 is in the sequence, because 2^21 - 1 - 2^2 - ... - 2^19 = 1431379 is prime (and has binary length 21).
MATHEMATICA
isA215888[n_] := PrimeQ[2^n-1 - Sum[2^Prime[k], {k, 1, PrimePi[n-1]}]]; Reap[For[n = 1, n < 10^5, n++, If[isA215888[n], Print[n]; Sow[n]]]][[2, 1]] (* Jean-François Alcover, Dec 26 2013, after PARI *)
PROG
(PARI) is_A215888(N)=ispseudoprime(2^N-1-sum(n=1, primepi(N-1), 2^prime(n)))
CROSSREFS
Sequence in context: A236836 A134942 A371260 * A240963 A053408 A269355
KEYWORD
nonn,hard,nice,more
AUTHOR
M. F. Hasler, Aug 25 2012
EXTENSIONS
More terms from Jean-François Alcover, Dec 26 2013
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 June 8 00:02 EDT 2024. Contains 373206 sequences. (Running on oeis4.)