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!)
A215222 Number of solutions to n = Sum_{i=1..pi(n-1)} c(i)*p(i) with c(i) in {-1,0,1}, p(n) = n-th prime and pi = A000720. 2
0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 1, 5, 5, 13, 12, 11, 11, 29, 28, 74, 73, 71, 69, 184, 182, 176, 173, 170, 164, 446, 437, 1180, 1165, 1147, 1137, 1115, 1104, 2984, 2949, 2919, 2887, 7841, 7778, 21331, 21184, 21029, 20861, 57465, 57114, 56741, 56372, 55997, 55610 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,8
LINKS
EXAMPLE
a(5) = 1: 5 = 3+2.
a(6) = 1: 6 = 5+3-2.
a(7) = 1: 7 = 5+2.
a(8) = 2: 8 = 5+3 = 7+3-2.
a(9) = 2: 9 = 7+2 = 7+5-3.
a(10) = 3: 10 = 5+3+2 = 7+3 = 7+5-2.
a(11) = 1: 11 = 7+5-3+2.
a(12) = 5: 12 = 7+3+2 = 7+5 = 11+3-2 = 11-7+5+3 = 11+7-5-3+2.
MAPLE
sp:= proc(n) option remember; `if`(n=0, 0, ithprime(n)+sp(n-1)) end:
b := proc(n, i) option remember; `if`(n>sp(i), 0, `if`(i=0, 1, b(n, i-1)+
b(n+ithprime(i), i-1)+ b(abs(n-ithprime(i)), i-1)))
end:
a:= n-> b(n, numtheory[pi](n-1)):
seq(a(n), n=1..60);
MATHEMATICA
sp[n_] := sp[n] = If[n == 0, 0, Prime[n]+sp[n-1]]; b[n_, i_] := b[n, i] = If[n>sp[i], 0, If[i == 0, 1, b[n, i-1] + b[n+Prime[i], i-1] + b[Abs[n-Prime[i]], i-1]]]; a[n_] := b[n, PrimePi[n-1]]; Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Dec 03 2014, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A096226 A155980 A309531 * A219865 A016539 A345886
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Aug 06 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 April 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)