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

A071330 Number of decompositions of n into sum of two prime powers.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 2, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 4, 4, 2, 5, 3, 5, 4, 5, 3, 6, 3, 7, 5, 7, 4, 7, 2, 6, 4, 6, 3, 6, 3, 6, 5, 6, 2, 8, 3, 8, 4, 6, 2, 9, 3, 7, 4, 6, 2, 8, 3, 7, 4, 7, 3, 9, 2, 8, 5, 7, 2, 10, 3, 8, 6, 7, 3, 9, 2, 9, 4, 7, 4, 11, 3, 9, 4, 7, 3, 12, 4, 8, 3, 7, 2
Offset: 1

Views

Author

Reinhard Zumkeller, May 19 2002

Keywords

Comments

a(2*n) > 0 (Goldbach's conjecture).
a(A071331(n)) = 0; A095840(n) = a(A000961(n)).

Examples

			10 = 1 + 3^2 = 2 + 2^3 = 3 + 7 = 5 + 5, therefore a(10) = 4;
11 = 2 + 3^2 = 3 + 2^3 = 4 + 7, therefore a(11) = 3;
12 = 1 + 11 = 3 + 3^2 = 2^2 + 2^3 = 5 + 7, therefore a(12) = 4;
a(149)=0, as for all x<149: if x is a prime power then 149-x is not.
		

Crossrefs

Programs

  • Haskell
    a071330 n = sum $
       map (a010055 . (n -)) $ takeWhile (<= n `div` 2) a000961_list
    -- Reinhard Zumkeller, Jan 11 2013
  • Mathematica
    primePowerQ[n_] := Length[ FactorInteger[n]] == 1; a[n_] := (r = 0; Do[ If[ primePowerQ[k] && primePowerQ[n-k], r++], {k, 1, Floor[n/2]}]; r); Table[a[n], {n, 1, 95}](* Jean-François Alcover, Nov 17 2011, after Michael B. Porter *)
  • PARI
    ispp(n) = (omega(n)==1 || n==1)
    A071330(n) = {local(r);r=0;for(i=1,floor(n/2),if(ispp(i) && ispp(n-i),r++));r} \\ Michael B. Porter, Dec 04 2009
    
  • PARI
    a(n)=my(s); forprime(p=2,n\2,if(isprimepower(n-p), s++)); for(e=2,log(n)\log(2), forprime(p=2, sqrtnint(n\2,e), if(isprimepower(n-p^e), s++))); s+(!!isprimepower(n-1))+(n==2) \\ Charles R Greathouse IV, Nov 21 2014
    

A282062 Expansion of (x + Sum_{p prime, k>=1} x^(p^k))^2.

Original entry on oeis.org

0, 0, 1, 2, 3, 4, 5, 4, 5, 6, 7, 6, 8, 6, 7, 6, 7, 6, 9, 6, 10, 8, 7, 4, 10, 6, 9, 8, 10, 6, 12, 6, 13, 10, 13, 8, 14, 4, 11, 8, 12, 6, 12, 6, 12, 10, 11, 4, 16, 6, 15, 8, 12, 4, 17, 6, 14, 8, 11, 4, 16, 6, 13, 8, 13, 6, 18, 4, 16, 10, 14, 4, 20, 6, 15, 12, 14, 6, 18, 4, 18, 8, 13, 8, 22, 6, 17, 8, 14, 6, 24, 8, 16, 6, 13, 4
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 05 2017

Keywords

Comments

Number of ways to write n as an ordered sum of two prime powers (1 included).

Examples

			a(8) = 5 because we have  [7, 1], [5, 3], [4, 4], [3, 5] and [1, 7].
		

Crossrefs

Programs

  • Maple
    N:= 100: # to get a(0)..a(N)
    P:= select(isprime, [$2..N]):
    g:= x + add(add(x^(p^k),k=1..floor(log[p](N))),p=P):
    S:= series(g^2,x,N+1):
    seq(coeff(S,x,n),n=0..N); # Robert Israel, Feb 10 2017
  • Mathematica
    nmax = 95; CoefficientList[Series[(x + Sum[Floor[1/PrimeNu[k]] x^k, {k, 2, nmax}])^2, {x, 0, nmax}], x]

Formula

G.f.: (x + Sum_{p prime, k>=1} x^(p^k))^2.

A095841 Prime powers having exactly one partition into two prime powers.

Original entry on oeis.org

2, 3, 127, 163, 179, 191, 193, 223, 239, 251, 269, 311, 337, 343, 389, 419, 431, 457, 491, 547, 557, 569, 599, 613, 653, 659, 673, 683, 719, 739, 787, 821, 839, 853, 883, 911, 929, 953, 967, 977, 1117, 1123, 1201, 1229, 1249, 1283, 1289, 1297, 1303, 1327, 1381, 1409, 1423, 1439, 1451, 1471, 1481, 1499, 1607, 1663, 1681
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 10 2004

Keywords

Comments

A095840(A095874(a(n))) = 1.
A071330(a(n)) = 1.

Crossrefs

Intersection of A208247 and A000961.

Programs

  • Haskell
    a095841 n = a095841_list !! (n-1)
    a095841_list = filter ((== 1) . a071330) a000961_list
    -- Reinhard Zumkeller, Jan 11 2013
    
  • Maple
    N:= 10^4: # to get all terms <= N
    primepows:= {1,seq(seq(p^n, n=1..floor(log[p](N))),
        p=select(isprime,[2,seq(2*k+1,k=1..(N-1)/2)]))}:
    npp:= nops(primepows):
    B:= Vector(N,datatype=integer[4]):
    for n from 1 to npp do for m from n to npp do
       j:= primepows[n]+primepows[m];
       if j <= N then B[j]:= B[j]+1 fi;
    od od:
    select(t -> B[t] = 1, primepows); # Robert Israel, Nov 21 2014
  • Mathematica
    max = 2000; ppQ[n_] := n == 1 || PrimePowerQ[n]; pp = Select[Range[max], ppQ]; lp = Length[pp]; Table[pp[[i]] + pp[[j]], {i, 1, lp}, {j, i, lp}] // Flatten // Select[#, ppQ[#] && # <= max&]& // Sort // Split // Select[#, Length[#] == 1&]& // Flatten (* Jean-François Alcover, Mar 04 2019 *)
  • PARI
    is(n)=if(n<127,return(n==2||n==3)); isprimepower(n) && sum(i=2,n\2,isprimepower(i)&&isprimepower(n-i))==1 \\ naive; Charles R Greathouse IV, Nov 21 2014
    
  • PARI
    is(n)=if(!isprimepower(n), return(0)); 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
    
  • PARI
    has(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
    list(lim)=my(v=List([2])); forprime(p=2,lim,if(has(p), listput(v,p))); for(e=2,log(lim)\log(2), forprime(p=2,lim^(1/e), if(has(p^e), listput(v,p^e)))); Set(v) \\ Charles R Greathouse IV, Nov 21 2014

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
    

A280242 Expansion of (Sum_{k>=2} floor(1/omega(k))*x^k)^2, where omega(k) is the number of distinct prime factors (A001221).

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 3, 4, 3, 4, 5, 6, 6, 6, 5, 6, 7, 4, 7, 6, 8, 8, 7, 4, 8, 6, 7, 8, 8, 6, 10, 6, 11, 8, 13, 8, 14, 4, 9, 8, 12, 6, 10, 6, 10, 10, 11, 4, 14, 6, 13, 8, 12, 4, 15, 6, 14, 8, 11, 4, 14, 6, 11, 8, 13, 4, 18, 4, 14, 10, 14, 4, 18, 6, 13, 12, 14, 6, 18, 4, 16, 8, 11, 8, 20, 6, 17, 8, 14, 6, 22, 8, 16, 6, 13, 4, 20, 4
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 29 2016

Keywords

Comments

Number of ordered ways of writing n as the sum of two prime powers (1 excluded).

Examples

			a(6) = 3 because we have [4, 2], [3, 3] and [2, 4].
		

Crossrefs

Programs

  • Mathematica
    nmax = 97; CoefficientList[Series[(Sum[Floor[1/PrimeNu[k]] x^k, {k, 2, nmax}])^2, {x, 0, nmax}], x]

Formula

G.f.: (Sum_{k>=2} floor(1/omega(k))*x^k)^2.
Showing 1-5 of 5 results.