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!)
A215966 Number of ways prime(n) can be expressed as the sum of distinct smaller noncomposites. 1
0, 1, 1, 1, 2, 3, 4, 6, 8, 12, 14, 21, 25, 29, 36, 50, 66, 75, 99, 117, 130, 169, 197, 251, 347, 401, 438, 502, 545, 626, 1026, 1167, 1422, 1525, 2087, 2234, 2687, 3222, 3611, 4312, 5120, 5445, 7182, 7618, 8468, 8974, 12364, 16896, 18653, 19675, 21709, 25205 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,5
COMMENTS
2 = prime(1) is the only prime number which is not expressible as the sum of distinct smaller noncomposites, i.e. there exists only one zero in the sequence.
LINKS
EXAMPLE
a(8) = 6: prime(8) = 19 can be expressed as the sum of distinct smaller noncomposites in 6 different ways: 17+2 = 13+5+1 = 13+3+2+1 = 11+7+1 = 11+5+3 = 11+5+2+1.
MAPLE
s:= proc(n) s(n):= `if`(n<1, n+1, s(n-1) +ithprime(n)) end:
b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i=0,
`if`(n=1, 1, 0), `if`(n>s(i), 0, b(n, i-1)+
`if`(ithprime(i)>n, 0, b(n-ithprime(i), i-1)))))
end:
a:= n-> b(ithprime(n), n-1):
seq (a(n), n=1..80); # Alois P. Heinz, Aug 29 2012
MATHEMATICA
s[n_] := If[n < 1, n + 1, s[n - 1] + Prime[n]];
b[n_, i_] := b[n, i] = If[n == 0, 1, If[i == 0, If[n == 1, 1, 0], If[n > s[i], 0, b[n, i - 1] + If[Prime[i] > n, 0, b[n - Prime[i], i - 1]]]]];
a[n_] := b[Prime[n], n - 1];
Array[a, 80] (* Jean-François Alcover, Nov 22 2020, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A014423 A101902 A236912 * A114312 A095041 A331088
KEYWORD
nonn
AUTHOR
Syed Iddi Hasan, Aug 29 2012
EXTENSIONS
More terms from Alois P. Heinz, Aug 29 2012
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 March 29 02:23 EDT 2024. Contains 371264 sequences. (Running on oeis4.)