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-10 of 18 results. Next

A259201 Number of partitions of n into ten primes.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 4, 4, 5, 7, 8, 9, 11, 11, 14, 16, 18, 20, 25, 24, 31, 33, 38, 39, 48, 47, 59, 59, 69, 69, 87, 80, 102, 98, 118, 114, 143, 131, 168, 154, 191, 179, 227, 200, 261, 236, 297, 268, 344, 300, 396, 345, 442, 390, 509, 431, 576, 493, 641, 551, 729
Offset: 20

Views

Author

Doug Bell, Jun 20 2015

Keywords

Examples

			a(23) = 2 because there are 2 partitions of 23 into ten primes: [2,2,2,2,2,2,2,2,2,5] and [2,2,2,2,2,2,2,3,3,3].
		

Crossrefs

Column k=10 of A117278.
Number of partitions of n into r primes for r = 1-9: A010051, A061358, A068307, A259194, A259195, A259196, A259197, A259198, A259200.

Programs

  • Magma
    [#RestrictedPartitions(k,10,Set(PrimesUpTo(1000))):k in [20..80]] ; // Marius A. Burtea, Jul 13 2019

Formula

a(n) = [x^n y^10] Product_{k>=1} 1/(1 - y*x^prime(k)). - Ilya Gutkovskiy, Apr 18 2019
a(n) = Sum_{r=1..floor(n/10)} Sum_{q=r..floor((n-r)/9)} Sum_{p=q..floor((n-q-r)/8)} Sum_{o=p..floor((n-p-q-r)/7)} Sum_{m=o..floor((n-o-p-q-r)/6)} Sum_{l=m..floor((n-m-o-p-q-r)/5)} Sum_{k=l..floor((n-l-m-o-p-q-r)/4)} Sum_{j=k..floor((n-k-l-m-o-p-q-r)/3)} Sum_{i=j..floor((n-j-k-l-m-o-p-q-r)/2)} A010051(r) * A010051(q) * A010051(p) * A010051(o) * A010051(m) * A010051(l) * A010051(k) * A010051(j) * A010051(i) * A010051(n-i-j-k-l-m-o-p-q-r). - Wesley Ivan Hurt, Jul 13 2019

A259200 Number of partitions of n into nine primes.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 4, 4, 5, 7, 7, 9, 10, 11, 12, 16, 16, 20, 21, 24, 26, 33, 31, 39, 39, 47, 46, 59, 53, 69, 65, 80, 77, 98, 85, 114, 104, 131, 118, 154, 133, 179, 155, 200, 177, 236, 196, 268, 227, 300, 256
Offset: 18

Views

Author

Doug Bell, Jun 20 2015

Keywords

Examples

			a(23) = 3 because there are 3 partitions of 23 into nine primes: [2,2,2,2,2,2,2,2,7], [2,2,2,2,2,2,3,3,5] and [2,2,2,2,3,3,3,3,3].
		

Crossrefs

Column k=9 of A117278.
Number of partitions of n into r primes for r = 1..10: A010051, A061358, A068307, A259194, A259195, A259196, A259197, A259198, this sequence, A259201.
Cf. A000040.

Programs

  • Magma
    [#RestrictedPartitions(k,9,Set(PrimesUpTo(1000))):k in [18..70]] ; // Marius A. Burtea, Jul 13 2019
  • Maple
    N:= 100: # to get a(0) to a(N)
    Primes:= select(isprime,[$1..N]):
    np:= nops(Primes):
    for j from 0 to np do g[0,j]:= 1 od:
    for n from 1 to 9 do
      g[n,0]:= 0:
      for j from 1 to np do
         g[n,j]:= convert(series(add(g[k,j-1]
              *x^((n-k)*Primes[j]),k=0..n),x,N+1),polynom)
      od
    od:
    seq(coeff(g[9,np],x,i),i=18..N) # Robert Israel, Jun 21 2015
  • Mathematica
    Table[Length[Select[IntegerPartitions[n],Length[#]==9&&AllTrue[ #, PrimeQ]&]], {n,18,70}] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jul 31 2016 *)
  • PARI
    a(n) = {nb = 0; forpart(p=n, if (#p && (#select(x->isprime(x), Vec(p)) == #p), nb+=1), , [9,9]); nb;} \\ Michel Marcus, Jun 21 2015
    

Formula

a(n) = [x^n y^9] Product_{k>=1} 1/(1 - y*x^prime(k)). - Ilya Gutkovskiy, Apr 18 2019
a(n) = Sum_{q=1..floor(n/9)} Sum_{p=q..floor((n-q)/8)} Sum_{o=p..floor((n-p-q)/7)} Sum_{m=o..floor((n-o-p-q)/6)} Sum_{l=m..floor((n-m-o-p-q)/5)} Sum_{k=l..floor((n-l-m-o-p-q)/4)} Sum_{j=k..floor((n-k-l-m-o-p-q)/3)} Sum_{i=j..floor((n-j-k-l-m-o-p-q)/2)} c(q) * c(p) * c(o) * c(m) * c(l) * c(k) * c(j) * c(i) * c(n-i-j-k-l-m-o-p-q), where c = A010051. - Wesley Ivan Hurt, Jul 13 2019

A117278 Triangle read by rows: T(n,k) is the number of partitions of n into k prime parts (n>=2, 1<=k<=floor(n/2)).

Original entry on oeis.org

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

Views

Author

Emeric Deutsch, Mar 07 2006

Keywords

Comments

Row n has floor(n/2) terms. Row sums yield A000607. T(n,1) = A010051(n) (the characteristic function of the primes). T(n,2) = A061358(n). Sum(k*T(n,k), k>=1) = A084993(n).

Examples

			T(12,3) = 2 because we have [7,3,2] and [5,5,2].
Triangle starts:
  1;
  1;
  0, 1;
  1, 1;
  0, 1, 1;
  1, 1, 1;
  0, 1, 1, 1;
  0, 1, 2, 1;
  ...
		

Crossrefs

Row sums give A000607.
T(A000040(n),n) gives A259254(n).

Programs

  • Maple
    g:=1/product(1-t*x^(ithprime(j)),j=1..30): gser:=simplify(series(g,x=0,30)): for n from 2 to 22 do P[n]:=sort(coeff(gser,x^n)) od: for n from 2 to 22 do seq(coeff(P[n],t^j),j=1..floor(n/2)) od; # yields sequence in triangular form
    # second Maple program:
    b:= proc(n, i) option remember;
          `if`(n=0, [1], `if`(i<1, [], zip((x, y)->x+y, b(n, i-1),
           [0, `if`(ithprime(i)>n, [], b(n-ithprime(i), i))[]], 0)))
        end:
    T:= n-> subsop(1=NULL, b(n, numtheory[pi](n)))[]:
    seq(T(n), n=2..25);  # Alois P. Heinz, Nov 16 2012
  • Mathematica
    (* As triangle: *) nn=20;a=Product[1/(1-y x^i),{i,Table[Prime[n],{n,1,nn}]}];Drop[CoefficientList[Series[a,{x,0,nn}],{x,y}],2,1]//Grid (* Geoffrey Critzer, Oct 30 2012 *)
  • PARI
    parts(n, pred)={prod(k=1, n, if(pred(k), 1/(1-y*x^k) + O(x*x^n), 1))}
    {my(n=15); apply(p->Vecrev(p/y), Vec(parts(n, isprime)-1))} \\ Andrew Howroyd, Dec 28 2017

Formula

G.f.: G(t,x) = -1+1/product(1-tx^(p(j)), j=1..infinity), where p(j) is the j-th prime.

A259196 Number of partitions of n into six primes.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 4, 3, 4, 5, 6, 6, 8, 7, 10, 10, 12, 11, 16, 12, 19, 17, 22, 18, 26, 20, 31, 24, 33, 27, 42, 29, 47, 35, 51, 38, 60, 41, 68, 47, 73, 53, 86, 54, 95, 64, 103, 70, 116, 73, 131, 81, 137, 89, 156, 92, 171, 103, 180, 112, 202, 117, 223, 127, 232
Offset: 12

Views

Author

Doug Bell, Jun 20 2015

Keywords

Examples

			a(17) = 3 because there are 3 partitions of 17 into six primes: [2,2,2,2,2,7], [2,2,2,3,3,5] and [2,3,3,3,3,3].
		

Crossrefs

Column k=6 of A117278.
Number of partitions of n into r primes for r = 1-10: A010051, A061358, A068307, A259194, A259195, this sequence, A259197, A259198, A259200, A259201.
Cf. A000040.

Programs

Formula

a(n) = Sum_{m=1..floor(n/6)} Sum_{l=m..floor((n-m)/5)} Sum_{k=l..floor((n-l-m)/4)} Sum_{j=k..floor((n-k-l-m)/3)} Sum_{i=j..floor((n-j-k-l-m)/2)} A010051(i) * A010051(j) * A010051(k) * A010051(l) * A010051(m) * A010051(n-i-j-k-l-m). - Wesley Ivan Hurt, Apr 17 2019
a(n) = [x^n y^6] Product_{k>=1} 1/(1 - y*x^prime(k)). - Ilya Gutkovskiy, Apr 18 2019

A259197 Number of partitions of n into seven primes.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 4, 4, 4, 6, 6, 8, 8, 9, 10, 14, 12, 16, 16, 19, 19, 26, 22, 30, 26, 34, 31, 43, 33, 48, 42, 56, 47, 66, 51, 77, 60, 84, 68, 99, 73, 112, 86, 123, 95, 143, 103, 162, 116, 174, 131, 200, 137, 220, 156, 241, 171, 270, 180, 300, 202, 322, 223, 359
Offset: 14

Views

Author

Doug Bell, Jun 20 2015

Keywords

Examples

			a(17) = 2 because there are 2 partitions of 17 into seven primes: [2,2,2,2,2,2,5] and [2,2,2,2,3,3,3].
		

Crossrefs

Column k=7 of A117278.
Number of partitions of n into r primes for r = 1-10: A010051, A061358, A068307, A259194, A259195, A259196, this sequence, A259198, A259200, A259201.
Cf. A000040.

Programs

  • Mathematica
    Table[Length@IntegerPartitions[n, {7}, Prime@Range@100], {n, 14, 100}] (* Robert Price, Apr 25 2025 *)

Formula

a(n) = Sum_{o=1..floor(n/7)} Sum_{m=o..floor((n-o)/6)} Sum_{l=m..floor((n-m-o)/5)} Sum_{k=l..floor((n-l-m-o)/4)} Sum_{j=k..floor((n-k-l-m-o)/3)} Sum_{i=j..floor((n-j-k-l-m-o)/2)} A010051(i) * A010051(j) * A010051(k) * A010051(l) * A010051(m) * A010051(o) * A010051(n-i-j-k-l-m-o). - Wesley Ivan Hurt, Apr 17 2019
a(n) = [x^n y^7] Product_{k>=1} 1/(1 - y*x^prime(k)). - Ilya Gutkovskiy, Apr 18 2019

A259198 Number of partitions of n into eight primes.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 4, 4, 5, 6, 7, 8, 10, 9, 12, 14, 16, 16, 21, 19, 26, 26, 31, 30, 39, 34, 46, 43, 53, 48, 65, 56, 77, 66, 85, 77, 104, 84, 118, 99, 133, 112, 155, 123, 177, 143, 196, 162, 227, 174, 256, 200, 282, 220, 318, 241, 360, 270, 389, 300, 442, 322
Offset: 16

Views

Author

Doug Bell, Jun 20 2015

Keywords

Examples

			a(20) = 2 because there are 2 partitions of 20 into eight primes: [2,2,2,2,2,2,3,5] and [2,2,2,2,3,3,3,3].
		

Crossrefs

Column k=8 of A117278.
Number of partitions of n into r primes for r = 1-10: A010051, A061358, A068307, A259194, A259195, A259196, A259197, this sequence, A259200, A259201.
Cf. A000040.

Programs

  • Mathematica
    Table[Length@IntegerPartitions[n, {8}, Prime@Range@100], {n, 16, 100}] (* Robert Price, Apr 25 2025 *)

Formula

a(n) = Sum_{p=1..floor(n/8)} Sum_{o=p..floor((n-p)/7)} Sum_{m=o..floor((n-o-p)/6)} Sum_{l=m..floor((n-m-o-p)/5)} Sum_{k=l..floor((n-l-m-o-p)/4)} Sum_{j=k..floor((n-k-l-m-o-p)/3)} Sum_{i=j..floor((n-j-k-l-m-o-p)/2)} A010051(i) * A010051(j) * A010051(k) * A010051(l) * A010051(m) * A010051(o) * A010051(p) * A010051(n-i-j-k-l-m-o-p). - Wesley Ivan Hurt, Apr 17 2019
a(n) = [x^n y^8] Product_{k>=1} 1/(1 - y*x^prime(k)). - Ilya Gutkovskiy, Apr 18 2019
a(n) = A326455(n)/n for n > 0. - Wesley Ivan Hurt, Jul 06 2019

A259195 Number of partitions of n into five primes.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 3, 5, 4, 6, 6, 7, 6, 10, 7, 11, 9, 12, 11, 17, 11, 18, 13, 20, 14, 24, 15, 27, 18, 29, 21, 35, 19, 38, 24, 41, 26, 47, 26, 53, 30, 54, 34, 64, 33, 70, 38, 73, 41, 81, 41, 89, 45, 92, 50, 103, 47, 112, 56, 117, 61, 127, 57
Offset: 0

Views

Author

Doug Bell, Jun 20 2015

Keywords

Examples

			a(17) = 3 because 17 can be written as the sum of five primes in exactly three ways: 2+2+3+3+7, 2+2+3+5+5, and 3+3+3+3+5.
		

Crossrefs

Column k=5 of A117278.
Number of partitions of n into r primes for r = 1..10: A010051, A061358, A068307, A259194, this sequence, A259196, A259197, A259198, A259200, A259201.
Cf. A000040.

Programs

Formula

a(n) = Sum_{l=1..floor(n/5)} Sum_{k=l..floor((n-l)/4)} Sum_{j=k..floor((n-k-l)/3)} Sum_{i=j..floor((n-j-k-l)/2)} c(i) * c(j) * c(k) * c(l) * c(n-i-j-k-l), where c = A010051. - Wesley Ivan Hurt, Apr 17 2019
a(n) = [x^n y^5] Product_{k>=1} 1/(1 - y*x^prime(k)). - Ilya Gutkovskiy, Apr 18 2019

Extensions

More terms from David A. Corneth, Sep 06 2020

A340960 Number of ways to write n as an ordered sum of 4 primes.

Original entry on oeis.org

1, 4, 6, 8, 13, 16, 22, 24, 22, 32, 34, 40, 47, 48, 56, 68, 70, 76, 90, 84, 111, 112, 126, 120, 144, 120, 176, 140, 184, 148, 226, 168, 264, 184, 262, 196, 313, 192, 352, 208, 366, 256, 418, 240, 473, 260, 496, 324, 536, 300, 616, 308, 634, 348, 670, 348, 772, 364, 786, 412
Offset: 8

Views

Author

Ilya Gutkovskiy, Jan 31 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, k) option remember; local r, p; r, p:= 0, 2;
          if n=0 then `if`(k=0, 1, 0) elif k<1 then 0 else
          while p<=n do r:= r+b(n-p, k-1); p:= nextprime(p) od; r fi
        end:
    a:= n-> b(n, 4):
    seq(a(n), n=8..67);  # Alois P. Heinz, Jan 31 2021
  • Mathematica
    nmax = 67; CoefficientList[Series[Sum[x^Prime[k], {k, 1, nmax}]^4, {x, 0, nmax}], x] // Drop[#, 8] &

Formula

G.f.: (Sum_{k>=1} x^prime(k))^4.

A341947 Number of partitions of n into 4 primes (counting 1 as a prime).

Original entry on oeis.org

1, 1, 2, 2, 4, 3, 5, 4, 6, 4, 7, 4, 9, 6, 10, 6, 12, 6, 14, 8, 15, 8, 18, 9, 21, 10, 20, 9, 23, 10, 26, 12, 27, 12, 31, 13, 34, 13, 33, 14, 39, 15, 42, 16, 43, 17, 48, 18, 53, 19, 52, 19, 58, 20, 61, 20, 61, 20, 68, 23, 73, 23, 73, 26, 82, 26, 84, 23, 84, 27, 92, 28, 98
Offset: 4

Views

Author

Ilya Gutkovskiy, Feb 24 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; series(`if`(n=0, 1,
         `if`(i<0, 0, (p-> `if`(p>n, 0, x*b(n-p, i)))(
         `if`(i=0, 1, ithprime(i)))+b(n, i-1))), x, 5)
        end:
    a:= n-> coeff(b(n, numtheory[pi](n)), x, 4):
    seq(a(n), n=4..76);  # Alois P. Heinz, Feb 24 2021
  • Mathematica
    b[n_, i_] := b[n, i] = Series[If[n == 0, 1,
         If[i < 0, 0, Function[p, If[p > n, 0, x*b[n - p, i]]][
         If[i == 0, 1, Prime[i]]] + b[n, i - 1]]], {x, 0, 5}];
    a[n_] := Coefficient[b[n, PrimePi[n]], x, 4];
    Table[a[n], {n, 4, 76}] (* Jean-François Alcover, Feb 15 2022, after Alois P. Heinz *)

A341451 Number of partitions of n into 4 nonprime parts.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 6, 5, 7, 8, 9, 10, 13, 13, 17, 17, 22, 21, 27, 27, 34, 34, 41, 40, 51, 49, 62, 59, 71, 70, 86, 82, 101, 97, 117, 112, 135, 131, 155, 150, 180, 170, 202, 196, 228, 222, 259, 248, 291, 281, 324, 314, 361, 348, 404, 388, 445, 431
Offset: 4

Views

Author

Ilya Gutkovskiy, Feb 12 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0,
          `if`(t=0, 1, 0), `if`(i<1 or t<1, 0, b(n, i-1, t)+
          `if`(isprime(i), 0, b(n-i, min(n-i, i), t-1))))
        end:
    a:= n-> b(n$2, 4):
    seq(a(n), n=4..69);  # Alois P. Heinz, Feb 12 2021
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0,
         If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i - 1, t] +
         If[PrimeQ[i], 0, b[n - i, Min[n - i, i], t - 1]]]];
    a[n_] := b[n, n, 4];
    Table[a[n], {n, 4, 69}] (* Jean-François Alcover, Aug 19 2021, after Alois P. Heinz *)
Showing 1-10 of 18 results. Next