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!)
A331981 Number of compositions (ordered partitions) of n into distinct odd primes. 3
1, 0, 0, 1, 0, 1, 0, 1, 2, 0, 2, 1, 2, 1, 2, 6, 4, 1, 4, 7, 4, 12, 4, 13, 6, 12, 28, 18, 28, 19, 6, 25, 52, 24, 54, 30, 56, 31, 98, 156, 102, 37, 104, 157, 150, 276, 150, 175, 154, 288, 200, 528, 246, 307, 226, 666, 990, 780, 1038, 679, 348, 799, 1828, 1272, 1162, 1164 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,9
LINKS
EXAMPLE
a(16) = 4 because we have [13, 3], [11, 5], [5, 11] and [3, 13].
MAPLE
s:= proc(n) option remember; `if`(n<1, 0, ithprime(n+1)+s(n-1)) end:
b:= proc(n, i, t) option remember; `if`(s(i)<n, 0, `if`(n=0, t!, (p
->`if`(p>n, 0, b(n-p, i-1, t+1)))(ithprime(i+1))+b(n, i-1, t)))
end:
a:= n-> b(n, numtheory[pi](n), 0):
seq(a(n), n=0..72); # Alois P. Heinz, Feb 03 2020
MATHEMATICA
s[n_] := s[n] = If[n < 1, 0, Prime[n + 1] + s[n - 1]];
b[n_, i_, t_] := b[n, i, t] = If[s[i] < n, 0, If[n == 0, t!, If[# > n, 0, b[n - #, i - 1, t + 1]]&[Prime[i + 1]] + b[n, i - 1, t]]];
a[n_] := b[n, PrimePi[n], 0];
a /@ Range[0, 72] (* Jean-François Alcover, Nov 09 2020, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A192541 A281545 A332033 * A099302 A219198 A352513
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Feb 03 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 April 23 20:33 EDT 2024. Contains 371916 sequences. (Running on oeis4.)