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

A219180 Number T(n,k) of partitions of n into k distinct prime parts; triangle T(n,k), n>=0, read by rows.

Original entry on oeis.org

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

Views

Author

Alois P. Heinz, Nov 13 2012

Keywords

Comments

T(n,k) is defined for all n>=0 and k>=0. The triangle contains only elements with 0 <= k <= A024936(n). T(n,k) = 0 for k > A024936(n). Three rows are empty because there are no partitions of n into distinct prime parts for n in {1,4,6}.

Examples

			T(0,0) = 1: [], the empty partition.
T(2,1) = 1: [2].
T(5,1) = 1: [5], T(5,2) = 1: [2,3].
T(16,2) = 2: [5,11], [3,13].
Triangle T(n,k) begins:
  1;
  ;
  0, 1;
  0, 1;
  ;
  0, 1, 1;
  ;
  0, 1, 1;
  0, 0, 1;
  0, 0, 1;
  0, 0, 1, 1;
  0, 1;
  0, 0, 1, 1;
  ...
		

Crossrefs

Row lengths are 1 + A024936(n).
Row sums give: A000586.
Last elements of rows give: A219181.
Row maxima give: A219182.
Least n with T(n,k) > 0 is A007504(k).

Programs

  • Maple
    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-1))[]], 0)))
        end:
    T:= proc(n) local l; l:= b(n, numtheory[pi](n));
           while nops(l)>0 and l[-1]=0 do l:= subsop(-1=NULL, l) od; l[]
        end:
    seq(T(n), n=0..50);
  • Mathematica
    nn=20;a=Table[Prime[n],{n,1,nn}];CoefficientList[Series[Product[1+y x^a[[i]],{i,1,nn}],{x,0,nn}],{x,y}]//Grid  (* Geoffrey Critzer, Nov 21 2012 *)
    zip[f_, x_List, y_List, z_] := With[{m = Max[Length[x], Length[y]]}, f[PadRight[x, m, z], PadRight[y, m, z]]]; b[n_, i_] := b[n, i] = If[n == 0, {1}, If[i<1, {}, zip[Plus, b[n, i-1], Join[{0}, If[Prime[i] > n, {}, b[n-Prime[i], i-1]]], 0]]]; T[n_] := Module[{l}, l = b[n, PrimePi[n]]; While[Length[l]>0 && l[[-1]] == 0, l = ReplacePart[l, -1 -> Sequence[]]]; l]; Table[T[n], {n, 0, 50}] // Flatten (* Jean-François Alcover, Jan 29 2014, after Alois P. Heinz *)
  • PARI
    T(n)={ Vec(prod(k=1, n, 1 + isprime(k)*y*x^k + O(x*x^n))) }
    { my(t=T(20)); for(n=1, #t, print(if(t[n]!=0, Vecrev(t[n]), []))) } \\ Andrew Howroyd, Dec 22 2017

Formula

G.f. of column k: Sum_{0
T(n,k) = [x^n*y^k] Product_{i>=1} (1+x^prime(i)*y).

A341464 Number of partitions of n into 5 distinct nonprime parts.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 4, 4, 5, 7, 7, 9, 12, 14, 15, 19, 21, 27, 29, 35, 38, 47, 49, 59, 65, 77, 82, 96, 102, 119, 128, 147, 157, 181, 189, 216, 231, 260, 276, 309, 327, 366, 387, 431, 454, 505, 529, 584, 617, 678, 713, 780, 818, 892, 938, 1020, 1071, 1164, 1213, 1311, 1378
Offset: 28

Author

Ilya Gutkovskiy, Feb 12 2021

Keywords

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-1), t-1))))
        end:
    a:= n-> b(n$2, 5):
    seq(a(n), n=28..88);  # 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 - 1], t - 1]]]];
    a[n_] := b[n, n, 5];
    Table[a[n], {n, 28, 88}] (* Jean-François Alcover, Jul 13 2021, after Alois P. Heinz *)

A341976 Number of partitions of n into 5 distinct primes (counting 1 as a prime).

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 2, 0, 2, 1, 3, 1, 4, 0, 3, 2, 6, 2, 6, 2, 7, 5, 9, 4, 10, 5, 10, 8, 12, 7, 12, 8, 15, 12, 16, 12, 18, 14, 20, 17, 22, 18, 23, 20, 27, 26, 29, 27, 30, 30, 33, 36, 36, 36, 35, 41, 43, 48, 43, 49, 43, 56, 52, 61, 51, 64, 52, 73, 64, 77, 58, 82, 64, 93
Offset: 18

Author

Ilya Gutkovskiy, Feb 24 2021

Keywords

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-1)))(
         `if`(i=0, 1, ithprime(i)))+b(n, i-1))), x, 6)
        end:
    a:= n-> coeff(b(n, numtheory[pi](n)), x, 5):
    seq(a(n), n=18..91);  # 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 - 1]]][
         If[i == 0, 1, Prime[i]]] + b[n, i - 1]]], {x, 0, 6}];
    a[n_] := Coefficient[b[n, PrimePi[n]], x, 5];
    Table[a[n], {n, 18, 100}] (* Jean-François Alcover, Jul 13 2021, after Alois P. Heinz *)

A358010 Number of partitions of n into at most 5 distinct prime parts.

Original entry on oeis.org

1, 0, 1, 1, 0, 2, 0, 2, 1, 1, 2, 1, 2, 2, 2, 2, 3, 2, 4, 3, 4, 4, 4, 5, 5, 5, 6, 5, 6, 7, 6, 9, 7, 9, 9, 9, 11, 11, 11, 13, 12, 13, 15, 15, 17, 15, 18, 17, 20, 20, 23, 20, 25, 22, 27, 28, 28, 27, 30, 29, 36, 34, 38, 36, 41, 35, 48, 41, 48, 44, 50, 46, 58, 53, 61, 54, 64, 55, 72, 66, 74
Offset: 0

Author

Ilya Gutkovskiy, Oct 24 2022

Keywords

A340001 Number of ways prime(n) is a sum of five distinct primes.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 5, 6, 11, 14, 16, 25, 29, 39, 57, 68, 75, 88, 92, 109, 169, 198, 235, 240, 322, 331, 379, 437, 497, 565, 635, 634, 803, 798, 896, 888, 1091, 1328, 1477, 1444, 1616, 1753, 1730, 2080, 2262, 2452, 2627, 2588, 2790, 3043, 3004, 3535
Offset: 1

Author

Michel Lagneau, Dec 26 2020

Keywords

Comments

Conjecture: all primes >= 43 are the sum of five distinct primes.
The sequence of the prime numbers that are the sum of five distinct prime numbers begins with 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, ...
The primes in the sequence are 2, 5, 11, 29, 109, 331, 379, 1091, 1753, ...
The squares in the sequence are 0, 1, 16, 25, 169, 1444, ...

Examples

			a(14) = 1 because prime(14) = 43 = 3 + 5 + 7 + 11 + 17.
a(17) = 5 because prime(17) = 59 = 3 + 5 + 7 + 13 + 31 = 3 + 5 + 11 + 17 + 23 = 3 + 7 + 13 + 17 + 19 = 5 + 7 + 11 + 13 + 23 = 5 + 7 + 11 + 17 + 19.
		

Programs

  • Maple
    b:= proc(n, i) option remember; series(`if`(n=0, 1,
          `if`(i<1, 0, b(n, i-1)+(p-> `if`(p>n, 0,
           x*b(n-p, i-1)))(ithprime(i)))), x, 6)
        end:
    a:= n-> coeff(b(ithprime(n), n), x, 5):
    seq(a(n), n=1..100);  # Alois P. Heinz, Dec 30 2020
  • Mathematica
    b[n_, i_] := b[n, i] = Series[If[n == 0, 1,
         If[i < 1, 0, b[n, i - 1] + Function[p, If[p > n, 0,
         x*b[n - p, i - 1]]][Prime[i]]]], {x, 0, 6}];
    a[n_] := SeriesCoefficient[b[Prime[n], n], {x, 0, 5}];
    Array[a, 100] (* Jean-François Alcover, Apr 26 2021, after Alois P. Heinz *)
    Table[Length[Select[IntegerPartitions[p,{5}],AllTrue[#,PrimeQ]&&Length[Union[#]]==5&]],{p,Prime[Range[70]]}] (* Harvey P. Dale, Jul 07 2024 *)

Formula

a(n) = A219199(A000040(n)).
a(n) = [x^prime(n)*y^5] Product_{i>=1} (1+x^prime(i)*y). - Alois P. Heinz, Dec 30 2020

A344989 Smallest number whose number of partitions into n distinct primes is n, or zero if there are no such partitions.

Original entry on oeis.org

2, 16, 26, 33, 55, 59, 0, 0, 124, 159, 233, 227, 276, 0, 372, 480, 0, 0, 0, 752, 0, 920, 0, 1011, 0, 1211, 1425, 0, 0, 0, 0, 0, 2050, 2336, 2495, 0, 0, 0, 0, 3340, 0, 3712, 0, 0, 4303, 0, 0, 0, 0, 5195, 0, 5669, 0, 6163, 6673, 0, 0, 0, 7504, 0, 0, 8670, 0, 9304, 9623, 0, 0, 0, 10638, 10981, 0, 12062, 0
Offset: 1

Author

Metin Sariyar, Jun 04 2021

Keywords

Comments

From David A. Corneth, Aug 21 2025: (Start)
How to prove a 0? I used the heuristic:
a(n) = 0 if 2*n consecutive integers can be written in strictly more than n ways as a sum of n distinct primes and up to that point no positive integer has exactly n such ways.
What other rules where used? (End)

Examples

			a(2) = 16 because 16 is the smallest number whose number of partitions into 2 distinct primes is 2; 16 = 3+13 = 5+11.
		

Crossrefs

Cf. A364692 asks for the largest number with the same properties.

Extensions

a(12)-a(20) from Alois P. Heinz, Jun 04 2021
More terms from David A. Corneth, Aug 21 2025
Showing 1-6 of 6 results.