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!)
A226178 Exponents n such that 2^n - previous_prime(2^n) = next_prime(2^n) - 2^n. 2
2, 6, 12, 76, 181, 1099, 1820, 9229 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
The differences next_prime(2^n) - 2^n are respectively: 1, 3, 3, 15, 165, 1035, 663, 2211.
If it exists, a(9) > 10000. - Hugo Pfoertner, Feb 06 2021
LINKS
FORMULA
A340707(a(n)) = 0. - Hugo Pfoertner, Feb 06 2021
EXAMPLE
2^6 = 64, next prime = 67, previous prime = 61, 67-64 = 64-61 = 3, hence 6 is in the sequence.
MATHEMATICA
Reap[Do[m = 2^n; p = NextPrime[m, -1]; q = NextPrime[m]; If[p + q == 2*m, Print[n]; Sow[n]], {n, 2, 10^4}]][[2, 1]]
PROG
(PARI) isok(n) = my(p=2^n); p-precprime(p-1) == nextprime(p+1) - p; \\ Michel Marcus, Oct 02 2019
(PARI) for(n=2, 1100, my(p2=2^n, pn=nextprime(p2), pp=p2-pn+p2); if(ispseudoprime(pp), if(precprime(p2)==pp, print1(n, ", ")))) \\ Hugo Pfoertner, Feb 06 2021
(Python)
from itertools import count, islice
from sympy import isprime, nextprime
def A226178_gen(): # generator of terms
return filter(lambda n:isprime(r:=((k:=1<<n)<<1)-(m:=nextprime(k))) and nextprime(r)==m, count(1))
A226178_list = list(islice(A226178_gen(), 5)) # Chai Wah Wu, Aug 08 2022
CROSSREFS
Sequence in context: A107763 A166470 A144144 * A129085 A274941 A141288
KEYWORD
nonn,hard,more
AUTHOR
EXTENSIONS
Offset 1 from Michel Marcus, Oct 02 2019
a(8) from Hugo Pfoertner, Feb 05 2021
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 19 18:05 EDT 2024. Contains 371798 sequences. (Running on oeis4.)