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.

Previous Showing 11-20 of 22 results. Next

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

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
    

A347643 Number of partitions of n into at most 2 prime powers (including 1).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Sep 09 2021

Keywords

Crossrefs

A137791 Number of ways to write n as sum of two positive numbers having no prime gaps in their factorization.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Feb 11 2008

Keywords

Examples

			a(20) = #{1+19,2+18,3+17,4+16,5+15,7+13,8+12,9+11} = 8;
a(21) = #{2+19,3+18,4+17,5+16,6+15,8+13,9+12} = 7;
a(22) = #{3+19,4+18,5+17,6+16,7+15,9+13,11+11} = 7;
a(23) = #{4+19,5+18,6+17,7+16,8+15,11+12} = 6;
a(24) = #{1+23,5+19,6+18,7+17,8+16,9+15,11+13,12+12} = 8.
		

Crossrefs

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.

A307726 Number of partitions of n into 2 prime powers (not including 1).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Apr 24 2019

Keywords

Examples

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

Crossrefs

Programs

  • Maple
    # note that this requires A246655 to be pre-computed
    f:= proc(n, k, pmax) option remember;
      local t, p, j;
      if n = 0 then return `if`(k=0, 1, 0) fi;
      if k = 0 then return 0 fi;
      if n > k*pmax then return 0 fi;
      t:= 0:
      for p in A246655 do
        if p > pmax then return t fi;
        t:= t + add(procname(n-j*p, k-j, min(p-1, n-j*p)), j=1..min(k, floor(n/p)))
      od;
      t
    end proc:
    map(f, [$0..100]); # Robert Israel, Apr 29 2019
  • Mathematica
    Array[Count[IntegerPartitions[#, {2}], _?(AllTrue[#, PrimePowerQ] &)] &, 101, 0]

Formula

a(n) = [x^n y^2] Product_{k>=1} 1/(1 - y*x^A246655(k)).

A109829 Number of distinct prime factors of 149 - (n-th prime power less than 149).

Original entry on oeis.org

2, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 3, 2, 2, 2, 3, 2, 3, 2, 3, 3, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 04 2005

Keywords

Comments

a(n) > 1: A071331(2) = 149, A071330(149) = 0.

Programs

  • Mathematica
    Join[{2},PrimeNu/@(149-Select[Range[0,148],PrimePowerQ])] (* Harvey P. Dale, Jan 27 2019 *)

Formula

a(n) = 149 - A000961(n) for n <= 48.

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

A306433 Number of partitions of n into 2 distinct prime powers (not including 1).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Apr 30 2019

Keywords

Examples

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

Crossrefs

Programs

  • Mathematica
    Table[Count[IntegerPartitions[n, {2}], _?(And[UnsameQ @@ #, AllTrue[#, PrimePowerQ[#] &]] &)], {n, 0, 95}]

Formula

a(n) = [x^n y^2] Product_{k>=1} (1 + y*x^A246655(k)).
Previous Showing 11-20 of 22 results. Next