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!)
A289154 Smallest prime p > 2^n such that none of p -+ 2^0, p -+ 2^1, p -+ 2^2, ..., p -+ 2^n are prime. 1

%I #10 Jul 07 2017 15:26:37

%S 5,23,53,211,251,787,787,1409,1777,1777,1973,3181,4889,8363,19583,

%T 34171,66683,131701,263227,527099,1049011,2098027,4196407,8389001,

%U 16779001,33555517,67108913,134219273,268435537,536871743,1073743303,2147485673,4294968857

%N Smallest prime p > 2^n such that none of p -+ 2^0, p -+ 2^1, p -+ 2^2, ..., p -+ 2^n are prime.

%H Charles R Greathouse IV, <a href="/A289154/b289154.txt">Table of n, a(n) for n = 0..200</a>

%e a(0) = 5 because prime 5 > 2^0 = 1 and none of 5 - 2^0 = 4, 5 + 2^0 = 6 are prime,

%e a(1) = 23 because prime 23 > 2^1 = 2 and none of 23 - 2^2 = 22, 23 + 2^0 = 24, 23 - 2^1 = 21, 23 + 2^1 = 25 are prime,

%e a(2) = 53 because prime 53 > 2^2 = 4 and none of 53 - 2^0 = 52, 53 + 2^0 = 54, 53 - 2^1 = 51, 53 + 2^1 = 55, 53 - 2^2 = 49, 53 + 2^2 = 57 are prime.

%t Table[p = NextPrime[2^n]; While[AnyTrue[p + Flatten@ Map[2^Range[0, n] # &, {-1, 1}], PrimeQ], p = NextPrime@ p]; p, {n, 0, 32}] (* _Michael De Vlieger_, Jun 27 2017 *)

%o (PARI) a(n)=if(n<1, return(5)); forprime(p=2^n+1,, for(k=1,n, if(isprime(p+2^k) || isprime(p-2^k), next(2))); return(p)) \\ _Charles R Greathouse IV_, Jul 07 2017

%Y Cf. A120937.

%K nonn

%O 0,1

%A _Juri-Stepan Gerasimov_, Jun 26 2017

%E More terms from _Michael De Vlieger_, Jun 27 2017

%E a(15) corrected by _Charles R Greathouse IV_, Jul 07 2017

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 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)