A219180 Number T(n,k) of partitions of n into k distinct prime parts; triangle T(n,k), n>=0, read by rows.
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
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; ...
Links
- Alois P. Heinz, Rows n = 0..1000, flattened
Crossrefs
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).
A341467 Number of partitions of n into 8 distinct nonprime parts.
1, 1, 1, 1, 2, 2, 4, 5, 6, 7, 10, 12, 16, 19, 24, 28, 36, 41, 52, 60, 73, 85, 102, 116, 142, 161, 192, 217, 256, 287, 339, 382, 442, 496, 574, 639, 737, 821, 937, 1041, 1184, 1309, 1483, 1640, 1845, 2037, 2283, 2508, 2807, 3081, 3430, 3761, 4170, 4553, 5045
Offset: 64
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-1), t-1)))) end: a:= n-> b(n$2, 8): seq(a(n), n=64..118); # 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], 0]]]; a[n_] := b[n, n, 8]; Table[a[n], {n, 64, 118}] (* Jean-François Alcover, Feb 22 2022, after Alois P. Heinz *)
A341979 Number of partitions of n into 8 distinct primes (counting 1 as a prime).
1, 0, 1, 0, 0, 0, 2, 0, 1, 0, 1, 0, 4, 0, 3, 0, 3, 1, 7, 0, 6, 1, 6, 1, 11, 0, 11, 2, 11, 3, 19, 1, 18, 3, 18, 5, 30, 4, 28, 6, 30, 10, 45, 6, 40, 11, 46, 16, 63, 11, 60, 19, 69, 25, 88, 18, 86, 32, 97, 36, 121, 32, 123, 47, 131, 55, 164, 49, 164, 69, 181, 80
Offset: 59
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-1)))( `if`(i=0, 1, ithprime(i)))+b(n, i-1))), x, 9) end: a:= n-> coeff(b(n, numtheory[pi](n)), x, 8): seq(a(n), n=59..130); # 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, 9}]; a[n_] := Coefficient[b[n, PrimePi[n]], x, 8]; Table[a[n], {n, 59, 130}] (* Jean-François Alcover, Feb 24 2022, after Alois P. Heinz *)
A344989 Smallest number whose number of partitions into n distinct primes is n, or zero if there are no such partitions.
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
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.
Links
- Chris K. Caldwell and G. L. Honaker, Jr., Prime Curios! 233
Crossrefs
Extensions
a(12)-a(20) from Alois P. Heinz, Jun 04 2021
More terms from David A. Corneth, Aug 21 2025
Comments