login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A115231 Primes p which cannot be written in the form 2^i + q^j where i >= 0, j >= 1, q = odd prime. 6

%I

%S 2,3,149,331,373,509,701,757,809,877,907,997,1019,1087,1259,1549,1597,

%T 1619,1657,1759,1777,1783,1867,1973,2293,2377,2503,2579,2683,2789,

%U 2843,2879,2909,2999,3119,3163,3181,3187,3299,3343,3433,3539,3643,3697,3739,3779

%N Primes p which cannot be written in the form 2^i + q^j where i >= 0, j >= 1, q = odd prime.

%C Union with A115232 gives all primes (A000040).

%C All terms > 3 are in A095842. - _M. F. Hasler_, Nov 20 2014

%H David A. Corneth, <a href="/A115231/b115231.txt">Table of n, a(n) for n = 1..11532</a> (terms <= 10^6)

%e A000040(35) = 149 = 2^7+3*7 = 2^6+5*17 = 2^5+3*3*13 =

%e 2^4+7*19 = 2^3+3*47 = 2^2+5*29 = 2^1+3*7*7 = 2^0+2*2*37, therefore 149 is a term (A115230(35)=0).

%t maxp = 3779; Complement[pp = Prime[Range[PrimePi[maxp]]], Union[Sort[Reap[Do[p = 2^i + q^j; If[p <= maxp && PrimeQ[p], Sow[p]], {i, 0, Log[2, maxp]//Ceiling}, {j, 1, Log[3, maxp]//Ceiling}, {q, Rest[pp]} ]][[2, 1]]]]] (* _Jean-Fran├žois Alcover_, Aug 03 2018 *)

%o (PARI) upto(n) = {my(pr = primes(primepi(n)), found = List(), s); for(i = 0, logint(n, 2), s = 2^i; forprime(q = 3, n - 2^i, for(j = 1, logint(n - 2^i, q),

%o listput(found, s + q^j)))); listsort(found, 1); setminus(Set(pr), Set(found))} \\ _David A. Corneth_, Aug 03 2018

%Y Cf. A095842, A115230, A115232, A115233, A000079, A061345.

%K nonn

%O 1,1

%A _Reinhard Zumkeller_, Jan 17 2006

%E Recomputed (based on recomputation of A115230) by _R. J. Mathar_ and _Reinhard Zumkeller_, Apr 29 2010.

%E Edited by _N. J. A. Sloane_, Apr 30 2010

%E 2, 3 inserted by _David A. Corneth_, Aug 03 2018

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 4 08:38 EST 2021. Contains 341781 sequences. (Running on oeis4.)