This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A226178 #24 Aug 09 2022 02:22:49 %S A226178 2,6,12,76,181,1099,1820,9229 %N A226178 Exponents n such that 2^n - previous_prime(2^n) = next_prime(2^n) - 2^n. %C A226178 The differences next_prime(2^n) - 2^n are respectively: 1, 3, 3, 15, 165, 1035, 663, 2211. %C A226178 If it exists, a(9) > 10000. - _Hugo Pfoertner_, Feb 06 2021 %F A226178 A340707(a(n)) = 0. - _Hugo Pfoertner_, Feb 06 2021 %e A226178 2^6 = 64, next prime = 67, previous prime = 61, 67-64 = 64-61 = 3, hence 6 is in the sequence. %t A226178 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]] %o A226178 (PARI) isok(n) = my(p=2^n); p-precprime(p-1) == nextprime(p+1) - p; \\ _Michel Marcus_, Oct 02 2019 %o A226178 (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 %o A226178 (Python) %o A226178 from itertools import count, islice %o A226178 from sympy import isprime, nextprime %o A226178 def A226178_gen(): # generator of terms %o A226178 return filter(lambda n:isprime(r:=((k:=1<<n)<<1)-(m:=nextprime(k))) and nextprime(r)==m, count(1)) %o A226178 A226178_list = list(islice(A226178_gen(),5)) # _Chai Wah Wu_, Aug 08 2022 %Y A226178 Cf. A000079, A014210, A014234, A117387, A145025. %Y A226178 Cf. A013597, A013603, A340707. %K A226178 nonn,hard,more %O A226178 1,1 %A A226178 _Jean-François Alcover_, May 30 2013 %E A226178 Offset 1 from _Michel Marcus_, Oct 02 2019 %E A226178 a(8) from _Hugo Pfoertner_, Feb 05 2021