[go: up one dir, main page]

login
A316185
Number of strict integer partitions of the n-th prime into a prime number of prime parts.
5
0, 0, 1, 1, 0, 1, 0, 2, 2, 3, 5, 5, 6, 8, 10, 13, 18, 20, 26, 32, 34, 45, 54, 66, 90, 106, 117, 135, 142, 165, 269, 311, 375, 398, 546, 579, 689, 823, 938, 1107, 1301, 1352, 1790, 1850, 2078, 2153, 2878, 3811, 4241, 4338, 4828, 5495, 5637, 7076, 8000, 9032
OFFSET
1,8
LINKS
FORMULA
a(n) = A045450(A000040(n)).
EXAMPLE
The a(14) = 8 partitions of 43 into a prime number of distinct prime parts: (41,2), (31,7,5), (29,11,3), (23,17,3), (23,13,7), (19,17,7), (19,13,11), (17,11,7,5,3).
MAPLE
h:= proc(n) option remember; `if`(n=0, 0,
`if`(isprime(n), n, h(n-1)))
end:
b:= proc(n, i, c) option remember; `if`(n=0,
`if`(isprime(c), 1, 0), `if`(i<2, 0, b(n, h(i-1), c)+
`if`(i>n, 0, b(n-i, h(min(n-i, i-1)), c+1))))
end:
a:= n-> b(ithprime(n)$2, 0):
seq(a(n), n=1..56); # Alois P. Heinz, May 26 2021
MATHEMATICA
Table[Length[Select[IntegerPartitions[Prime[n]], And[UnsameQ@@#, PrimeQ[Length[#]], And@@PrimeQ/@#]&]], {n, 10}]
(* Second program: *)
h[n_] := h[n] = If[n == 0, 0, If[PrimeQ[n], n, h[n - 1]]];
b[n_, i_, c_] := b[n, i, c] = If[n == 0,
If[PrimeQ[c], 1, 0], If[i < 2, 0, b[n, h[i - 1], c] +
If[i > n, 0, b[n - i, h[Min[n - i, i - 1]], c + 1]]]];
a[n_] := b[Prime[n], Prime[n], 0];
Array[a, 56] (* Jean-François Alcover, Jun 11 2021, after Alois P. Heinz *)
PROG
(PARI) seq(n)={my(p=vector(n, k, prime(k))); my(v=Vec(prod(k=1, n, 1 + x^p[k]*y + O(x*x^p[n])))); vector(n, k, sum(i=1, k, polcoeff(v[1+p[k]], p[i])))} \\ Andrew Howroyd, Jun 26 2018
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 25 2018
EXTENSIONS
More terms from Alois P. Heinz, Jun 26 2018
STATUS
approved