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-4 of 4 results.

A095840 Number of ways to write the n-th prime power as sum of two prime powers.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 3, 3, 2, 3, 4, 3, 3, 7, 2, 3, 3, 2, 3, 2, 2, 3, 7, 2, 2, 3, 2, 4, 4, 3, 2, 2, 2, 2, 2, 4, 2, 3, 1, 11, 3, 3, 4, 0, 2, 3, 1, 3, 3, 3, 1, 4, 1, 1, 2, 4, 2, 1, 3, 3, 2, 1, 3, 5, 1, 12, 3, 2, 1, 3, 2, 2, 3, 2, 4, 2, 1, 2, 2, 0, 1, 1, 3, 2, 4, 2, 3, 2, 0, 2, 3, 1, 2, 2, 2, 1, 3
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 10 2004

Keywords

Comments

a(n) = A071330(A000961(n)).
See A095842 and A095841 for prime powers having no more than one partition into two prime powers.

Examples

			A000961(8) = 3^2 = 9 = 1+8 = 2+7 = 4+5, therefore a(8)=3.
		

Programs

A095842 Prime powers having no partition into two prime powers.

Original entry on oeis.org

1, 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
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 10 2004

Keywords

Comments

A095840(A095874(a(n))) = 0.
A071330(a(n)) = 0.
Here, "prime powers" is used in the relaxed sense, including 1. The numbers 96721, 121801, 192721, 205379, 226981,... seem to be the smallest composite terms of this sequence, which establishes the difference with the subsequence A115231. - M. F. Hasler, Nov 20 2014

Crossrefs

Subsequence of A071331.

Programs

  • Haskell
    a095842 n = a095842_list !! (n-1)
    a095842_list = filter ((== 0) . a071330) a000961_list
    -- Reinhard Zumkeller, Jan 11 2013
  • PARI
    isprimepower(n)=ispower(n,,&n);isprime(n)||n==1;
    isA095842(n)=if(!isprimepower(n),return(0));forprime(p=2,n\2,if(isprimepower(n-p),return(0)));forprime(p=2,sqrtint(n\2),for(e=1,log(n\2)\log(p),if(isprimepower(n-p^e),return(0))));!isprimepower(n-1)
    \\ Charles R Greathouse IV, Jul 06 2011
    

A208247 Numbers having exactly one partition into two prime powers.

Original entry on oeis.org

2, 3, 119, 127, 163, 179, 191, 193, 217, 219, 221, 223, 239, 251, 269, 311, 337, 343, 389, 403, 415, 419, 427, 431, 457, 491, 505, 547, 557, 569, 575, 581, 583, 597, 599, 613, 653, 659, 667, 671, 673, 683, 697, 719, 739, 749, 767, 779, 787, 799, 807, 817
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 11 2013

Keywords

Comments

A071330(a(n)) = 1.

Crossrefs

A095841 = Intersection of A208247 and A000961.

Programs

  • Haskell
    a095841 n = a095841_list !! (n-1)
    a095841_list = filter ((== 1) . a071330) a000961_list
    
  • PARI
    is(n)=sum(i=2,n\2,isprimepower(i)&&isprimepower(n-i))+isprimepower(n-1)==1 || n==2 \\ naive; Charles R Greathouse IV, Nov 21 2014
    
  • PARI
    is(n)=my(s); forprime(p=2,n\2,if(isprimepower(n-p) && s++>1, return(0))); for(e=2,log(n)\log(2), forprime(p=2, sqrtnint(n\2,e), if(isprimepower(n-p^e) && s++>1,return(0)))); s+(!!isprimepower(n-1))==1 || n==2 \\ faster; Charles R Greathouse IV, Nov 21 2014

A248412 Smallest prime p such that p - 2^e is also prime power (A053810) in exactly n cases for nonnegative integers e.

Original entry on oeis.org

149, 2, 5, 11, 83, 829, 3331, 32941, 176417, 854929, 2233531, 12699571, 47924959, 763597201
Offset: 0

Views

Author

Robert G. Wilson v, Oct 06 2014

Keywords

Comments

first case when A115230 equals n.
0: 149, 331, 373, 509, 701, 757, 809, 877, 907, 997, 1019, ...;
1: 2, 3, 127, 163, 179, 191, 193, 223, 239, 251, 269, 311, ...;
2: 5, 7, 23, 37, 47, 53, 59, 67, 71, 79, 97, 101, 103, ...;
3: 11, 13, 17, 19, 29, 31, 41, 43, 61, 73, 89, 131, 137, ...;
4: 83, 113, 139, 181, 199, 293, 353, 571, 593, 601, 619, ...;
5: 829, 1217, 1487, 2131, 2341, 2551, 2971, 4051, 4261, ...;
6: 3331, 12109, 14551, 17393, 18233, 22279, 22307, 22741, ...;
7: 32941, 34369, 44029, 49433, 53633, 67189, 95717, 99833, ...;
8: 176417, 304771, 314723, 314779, 349667, 414707, 451937, ...;
9: 854929, 1297651, 1328927, 1784723, 2164433, 2488909, ...;
10: 2233531, 6026089, 7475389, 7623229, 9644911, 10019551, ...;
11: 12699571, 18464123, 52849879, 78127339, 79303579, 84397463, ...;
12: 47924959, 153309649, 204797059, 248685923, 273865219, ...;
13: 763597201, ...;
...

Crossrefs

Cf. A115230, A244917, zeroth row A095842, first row A095841.

Programs

  • Mathematica
    f[p_] := Length@ Table[q = p - 2^exp; If[ PrimeNu@ q == 1, {q}, Sequence @@ {}], {exp, 0, Floor@ Log2@ p}]; t = Table[0, {20}]; p = 2; While[p < 1000000000, a = f[p] +1; If[a < 101 && t[[a]] == 0, t[[a]] == p; Print[{a -1, p}]]; p = NextPrime@ p]; t

Formula

a(n) <= A244917(n) for n>0.
Showing 1-4 of 4 results.