cp's OEIS Frontend

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.

Showing 1-3 of 3 results.

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

Original entry on oeis.org

2, 3, 149, 331, 373, 509, 701, 757, 809, 877, 907, 997, 1019, 1087, 1259, 1549, 1597, 1619, 1657, 1759, 1777, 1783, 1867, 1973, 2293, 2377, 2503, 2579, 2683, 2789, 2843, 2879, 2909, 2999, 3119, 3163, 3181, 3187, 3299, 3343, 3433, 3539, 3643, 3697, 3739, 3779
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 17 2006

Keywords

Comments

Union with A115232 gives all primes (A000040).
All terms > 3 are in A095842. - M. F. Hasler, Nov 20 2014

Examples

			A000040(35) = 149 = 2^7+3*7 = 2^6+5*17 = 2^5+3*3*13 =
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).
		

Crossrefs

Programs

  • Mathematica
    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 *)
  • 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),
    listput(found, s + q^j)))); listsort(found, 1); setminus(Set(pr), Set(found))} \\ David A. Corneth, Aug 03 2018

Extensions

Recomputed (based on recomputation of A115230) by R. J. Mathar and Reinhard Zumkeller, Apr 29 2010.
Edited by N. J. A. Sloane, Apr 30 2010
2, 3 inserted by David A. Corneth, Aug 03 2018

A115230 Let p = prime(n); a(n) = number of ways to write p = 2^i + q^j where i >= 0, j >= 1, q = odd prime.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 3, 3, 2, 3, 3, 2, 3, 3, 2, 2, 2, 3, 2, 2, 3, 2, 4, 3, 2, 2, 2, 2, 2, 4, 1, 3, 3, 4, 0, 2, 3, 1, 3, 3, 1, 4, 1, 1, 2, 4, 2, 1, 3, 3, 2, 1, 3, 1, 3, 2, 1, 3, 2, 2, 3, 4, 2, 1, 2, 2, 0, 1, 3, 2, 4, 2, 2, 0, 2, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 3, 3, 0, 2, 3, 2, 1, 1, 3, 1, 4
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 17 2006

Keywords

Examples

			n=25: A000040(25) = 97 = 2^6 + 3*11 = 2^5 + 5*13 = 2^4 + 3^4 = 2^3 + 89^1 = 2^2 + 3*31 = 2^1 + 5*19 = 2^0 + 3*2^5, therefore a(25) = #{[16+81], [8+89]} = 2.
		

Crossrefs

Programs

  • Maple
    From Reinhard Zumkeller, Apr 30 2010: (Start)
    A000035 := proc(n) n mod 2 ; end proc:
    A000108 := proc(n) binomial(2*n,n)/(n+1) ; end proc:
    A036987 := proc(n) A000108(n) mod 2 ; end proc:
    A010055 := proc(n) if n = 1 then 1; else numtheory[factorset](n) ; if nops(%) = 1 then 1; else 0; end if; end if: end proc:
    A115230 := proc(n) p := ithprime(n) ; add(A036987(k-1)*A000035(p-k)*A010055(p-k), k=1..p-1) ; end proc: seq(A115230(n),n=1..40) ; # R. J. Mathar, Apr 30 2010 (End)
  • Mathematica
    f[p_] := Length@ Table[q = p - 2^exp; If[ PrimeNu@ q == 1, {q}, Sequence @@ {}], {exp, 0, Floor@ Log2@ p}]; Table[ f[ Prime[ n]], {n, 105}] (* Robert G. Wilson v, Oct 05 2014 *)

Formula

a(n) = Sum_{k=1..prime(n)-1} A036987(k-1)*A000035(p-k)*A010055(p-k). - Reinhard Zumkeller, Apr 29 2010

Extensions

Recomputed by Charles R Greathouse IV, Ray Chandler, R. J. Mathar, and Reinhard Zumkeller, Apr 29 2010; thanks to Charles R Greathouse IV, who pointed out that there were many errors in entries of A115230-A115233.
Edited by N. J. A. Sloane, Apr 30 2010
Formula corrected (thanks to R. J. Mathar, who found an error in it) by Reinhard Zumkeller, Apr 30 2010

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

Original entry on oeis.org

5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 17 2006

Keywords

Comments

a(n)=A000040(n+2) for n <= 32, but A000040(35)=149 is a term of A115231;
A115233 is a subsequence; the union with A115231 gives all primes (A000040);
A006512 and A053703 are subsequences.

Crossrefs

Programs

  • Mathematica
    maxp = 281;
    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, Prime[Range[2, PrimePi[maxp]]]}]][[2, 1]]]] (* Jean-François Alcover, Aug 03 2018 *)

Extensions

Recomputed (based on recomputation of A115230) by R. J. Mathar and Reinhard Zumkeller, Apr 29 2010
Edited by N. J. A. Sloane, Apr 30 2010
Terms a(1)=2 and a(2)=3 removed from Data by Jean-François Alcover, Aug 03 2018
Showing 1-3 of 3 results.