login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A316154 Number of integer partitions of prime(n) into a prime number of prime parts. 5
0, 0, 1, 2, 3, 5, 9, 12, 19, 39, 50, 93, 136, 166, 239, 409, 682, 814, 1314, 1774, 2081, 3231, 4272, 6475, 11077, 14270, 16265, 20810, 23621, 30031, 68251, 85326, 118917, 132815, 226097, 251301, 342448, 463940, 565844, 759873, 1015302, 1117708, 1787452, 1961624 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000 (first 200 terms from Andrew Howroyd)
FORMULA
a(n) = A085755(A000040(n)). - Alois P. Heinz, Jun 26 2018
EXAMPLE
The a(7) = 9 partitions of 17 into a prime number of prime parts: (13,2,2), (11,3,3), (7,7,3), (7,5,5), (7,3,3,2,2), (5,5,3,2,2), (5,3,3,3,3), (5,2,2,2,2,2,2), (3,3,3,2,2,2,2).
MAPLE
b:= proc(n, p, c) option remember; `if`(n=0 or p=2,
`if`(n::even and isprime(c+n/2), 1, 0),
`if`(p>n, 0, b(n-p, p, c+1))+b(n, prevprime(p), c))
end:
a:= n-> b(ithprime(n)$2, 0):
seq(a(n), n=1..50); # Alois P. Heinz, Jun 26 2018
MATHEMATICA
Table[Length[Select[IntegerPartitions[Prime[n]], And[PrimeQ[Length[#]], And@@PrimeQ/@#]&]], {n, 20}]
(* Second program: *)
b[n_, p_, c_] := b[n, p, c] = If[n == 0 || p == 2, If[EvenQ[n] && PrimeQ[c + n/2], 1, 0], If[p>n, 0, b[n - p, p, c + 1]] + b[n, NextPrime[p, -1], c]];
a[n_] := b[Prime[n], Prime[n], 0];
Array[a, 50] (* Jean-François Alcover, May 20 2021, after Alois P. Heinz *)
PROG
(PARI) seq(n)={my(p=vector(n, k, prime(k))); my(v=Vec(1/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
CROSSREFS
Sequence in context: A184794 A144728 A051147 * A079741 A000861 A108168
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 25 2018
EXTENSIONS
Terms a(21) and beyond from Andrew Howroyd, Jun 26 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 9 10:37 EDT 2024. Contains 375040 sequences. (Running on oeis4.)