Displaying 1-10 of 19 results found.
Number of partitions of n into ten primes.
+10
23
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
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
EXAMPLE
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].
PROG
(Magma) [#RestrictedPartitions(k, 10, Set(PrimesUpTo(1000))):k in [20..80]] ; // Marius A. Burtea, Jul 13 2019
Number of partitions of n into nine primes.
+10
22
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
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)} 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). - Wesley Ivan Hurt, Jul 13 2019
EXAMPLE
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].
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:
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 *)
PROG
(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
(Magma) [#RestrictedPartitions(k, 9, Set(PrimesUpTo(1000))):k in [18..70]] ; // Marius A. Burtea, Jul 13 2019
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)).
+10
21
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
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).
FORMULA
G.f.: G(t,x) = -1+1/product(1-tx^(p(j)), j=1..infinity), where p(j) is the j-th prime.
EXAMPLE
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;
...
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)))[]:
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 *)
PROG
(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
Number of partitions of n into seven primes.
+10
20
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
FORMULA
a(n) = [x^n y^7] Product_{k>=1} 1/(1 - y*x^prime(k)). - Ilya Gutkovskiy, Apr 18 2019
EXAMPLE
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].
Number of partitions of n into eight primes.
+10
20
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
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
EXAMPLE
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].
Number of partitions of n into four primes.
+10
19
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 2, 3, 3, 4, 4, 6, 3, 6, 5, 7, 5, 9, 5, 11, 7, 11, 7, 13, 6, 14, 9, 15, 8, 18, 9, 21, 10, 19, 11, 24, 10, 26, 12, 26, 13, 30, 12, 34, 15, 33, 16, 38, 14, 41, 17, 41, 16, 45, 16, 50, 19, 47, 21, 56, 20, 61, 20, 57
FORMULA
a(n) = [x^n y^4] Product_{k>=1} 1/(1 - y*x^prime(k)). - Ilya Gutkovskiy, Apr 18 2019
EXAMPLE
a(17) = 3 because 17 can be written as the sum of four primes in exactly three ways: 2+2+2+11, 2+3+5+7 and 2+5+5+5.
MATHEMATICA
a[n_] := Length@ IntegerPartitions[n, {4}, Prime@ Range@ PrimePi@ n]; a /@
Table[Count[IntegerPartitions[n, {4}], _?(AllTrue[#, PrimeQ]&)], {n, 0, 80}] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Feb 03 2019 *)
PROG
(PARI) a(n) = {nb = 0; forpart(p=n, if (#p && (#select(x->isprime(x), Vec(p)) == #p), nb+=1), , [4, 4]); nb; } \\ Michel Marcus, Jun 21 2015
(Magma) [0] cat [#RestrictedPartitions(n, 4, {d:d in PrimesUpTo(n)}):n in [1..100]]; // Marius A. Burtea, May 07 2019
Number of partitions of n into five primes.
+10
18
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
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
EXAMPLE
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.
MATHEMATICA
Array[Count[IntegerPartitions[#, {5}], _?(AllTrue[#, PrimeQ] &)] &, 71] (* Michael De Vlieger, Apr 21 2019 *)
PROG
(PARI) a(n) = {nb = 0; forpart(p=n, if (#p && (#select(x->isprime(x), Vec(p)) == #p), nb+=1), , [5, 5]); nb; } \\ Michel Marcus, Jun 21 2015
(Magma) [0] cat [#RestrictedPartitions(n, 5, {p:p in PrimesUpTo(n)}):n in [1..70]]; // Marius A. Burtea, May 09 2019
Number of ways to write n as an ordered sum of 6 primes.
+10
12
1, 6, 15, 26, 45, 72, 106, 150, 186, 236, 306, 366, 455, 540, 636, 782, 912, 1056, 1236, 1410, 1617, 1896, 2106, 2400, 2696, 2976, 3348, 3716, 4026, 4446, 4917, 5340, 5982, 6380, 7017, 7476, 8377, 8640, 9765, 9936, 11202, 11496, 13132, 12930, 15117, 14672, 17178, 16800, 19696
FORMULA
G.f.: (Sum_{k>=1} x^prime(k))^6.
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, 6):
MATHEMATICA
nmax = 60; CoefficientList[Series[Sum[x^Prime[k], {k, 1, nmax}]^6, {x, 0, nmax}], x] // Drop[#, 12] &
CROSSREFS
Cf. A000040, A010051, A073610, A098238, A259196, A340960, A340961, A340963, A340964, A340965, A340966.
Number of partitions of n into 6 primes (counting 1 as a prime).
+10
11
1, 1, 2, 2, 4, 4, 7, 6, 9, 8, 12, 10, 16, 12, 19, 15, 24, 18, 29, 21, 35, 25, 41, 29, 49, 33, 56, 37, 63, 41, 72, 46, 82, 51, 91, 58, 105, 63, 115, 68, 128, 77, 143, 83, 158, 90, 174, 101, 193, 107, 211, 116, 231, 128, 250, 134, 273, 142, 294, 157, 321, 165, 347, 176, 374
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, 7)
end:
a:= n-> coeff(b(n, numtheory[pi](n)), x, 6):
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, 7}];
a[n_] := Coefficient[b[n, PrimePi[n]], x, 6];
Number of partitions of n into 6 nonprime parts.
+10
10
1, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 6, 6, 7, 9, 10, 12, 15, 16, 20, 23, 27, 30, 36, 40, 48, 53, 62, 68, 81, 87, 105, 112, 130, 141, 166, 176, 208, 219, 256, 271, 314, 331, 385, 403, 468, 488, 561, 588, 674, 702, 804, 837, 952, 991, 1126, 1168, 1321, 1372
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, 6):
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], 0]]];
a[n_] := b[n, n, 6];
Table[Count[IntegerPartitions[n, {6}], _?(NoneTrue[#, PrimeQ]&)], {n, 6, 70}] (* Harvey P. Dale, Feb 21 2023 *)
CROSSREFS
Cf. A002095, A005171, A018252, A062610, A259196, A341408, A341451, A341452, A341454, A341455, A341457.
Search completed in 0.013 seconds
|