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!)
A339434 Number of compositions (ordered partitions) of n into a prime number of distinct prime parts. 1
0, 0, 0, 0, 0, 2, 0, 2, 2, 2, 8, 0, 8, 2, 8, 8, 10, 0, 16, 8, 16, 14, 16, 12, 18, 14, 22, 18, 136, 18, 138, 26, 22, 26, 258, 30, 266, 30, 266, 158, 492, 36, 506, 158, 510, 278, 744, 174, 748, 290, 758, 528, 990, 306, 1228, 668, 1116, 780, 6384, 678, 6630, 800, 1720, 1274 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,6
LINKS
EXAMPLE
a(10) = 8 because we have [7, 3], [3, 7], [5, 3, 2], [5, 2, 3], [3, 5, 2], [3, 2, 5], [2, 5, 3] and [2, 3, 5].
MAPLE
s:= proc(n) option remember; `if`(n<1, 0, ithprime(n)+s(n-1)) end:
b:= proc(n, i, t) option remember; `if`(s(i)<n, 0,
`if`(n=0, `if`(isprime(t), t!, 0), (p->`if`(p>n, 0,
b(n-p, i-1, t+1)))(ithprime(i))+b(n, i-1, t)))
end:
a:= n-> b(n, numtheory[pi](n), 0):
seq(a(n), n=0..70); # Alois P. Heinz, Dec 04 2020
MATHEMATICA
s[n_] := s[n] = If[n < 1, 0, Prime[n] + s[n - 1]];
b[n_, i_, t_] := b[n, i, t] = If[s[i] < n, 0,
If[n == 0, If[PrimeQ[t], t!, 0], Function[p, If[p > n, 0,
b[n - p, i - 1, t + 1]]][Prime[i]] + b[n, i - 1, t]]];
a[n_] := b[n, PrimePi[n], 0];
Table[a[n], {n, 0, 70}] (* Jean-François Alcover, Mar 01 2022, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A207944 A063088 A101276 * A348325 A103863 A166395
KEYWORD
nonn,look
AUTHOR
Ilya Gutkovskiy, Dec 04 2020
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 June 23 18:37 EDT 2024. Contains 373653 sequences. (Running on oeis4.)