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).
A341462 Number of partitions of n into 4 distinct nonprime parts.
1, 1, 1, 1, 2, 2, 3, 3, 5, 5, 7, 6, 10, 9, 13, 12, 17, 17, 21, 21, 28, 28, 34, 33, 42, 43, 51, 53, 61, 63, 73, 76, 87, 91, 102, 104, 119, 123, 137, 143, 157, 164, 179, 187, 205, 215, 232, 239, 262, 272, 294, 309, 327, 341, 365, 381, 406, 427, 448, 465
Offset: 19
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, 4): seq(a(n), n=19..78); # 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, 4]; Table[a[n], {n, 19, 78}] (* Jean-François Alcover, Jul 13 2021, after Alois P. Heinz *) Table[Length[Select[IntegerPartitions[n,{4}],Length[#]==Length[ Union[ #]] && NoneTrue[#,PrimeQ]&]],{n,19,80}] (* Harvey P. Dale, Nov 07 2021 *)
A341975 Number of partitions of n into 4 distinct primes (counting 1 as a prime).
1, 0, 1, 0, 1, 1, 2, 0, 2, 1, 3, 2, 4, 2, 4, 3, 5, 4, 5, 3, 5, 6, 7, 6, 6, 7, 8, 9, 9, 10, 7, 10, 9, 12, 10, 12, 9, 15, 12, 16, 13, 18, 12, 20, 14, 22, 16, 23, 13, 27, 16, 29, 19, 30, 14, 33, 19, 36, 21, 35, 15, 43, 23, 43, 23, 43, 18, 52, 26, 51, 26, 52, 21, 64, 29, 58, 28, 64
Offset: 11
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, 5) end: a:= n-> coeff(b(n, numtheory[pi](n)), x, 4): seq(a(n), n=11..88); # 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, 5}]; a[n_] := Coefficient[b[n, PrimePi[n]], x, 4]; Table[a[n], {n, 11, 100}] (* Jean-François Alcover, Jul 13 2021, after Alois P. Heinz *)
A358009 Number of partitions of n into at most 4 distinct prime parts.
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, 5, 7, 5, 9, 7, 9, 7, 9, 9, 11, 9, 12, 8, 13, 11, 14, 13, 13, 12, 16, 14, 18, 17, 16, 17, 20, 17, 23, 19, 21, 19, 24, 23, 28, 24, 26, 25, 26, 30, 30, 29, 29, 29, 32, 36, 37, 36, 32, 38, 35, 43, 41, 43, 20
Offset: 0
Keywords
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