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!)
A215221 Number of solutions to p(n) = Sum_{i=1..n-1} c(i)*p(i) with c(i) in {-1,0,1} and p(n) = n-th prime. 2
0, 0, 1, 1, 1, 5, 11, 28, 69, 164, 437, 1104, 2887, 7778, 20861, 55610, 148857, 408694, 1112103, 3059571, 8519916, 23586160, 65766961, 183122954, 508287720, 1423807763, 4019399991, 11359914488, 32294035715, 91866217942, 258134484981, 732226048291 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,6
LINKS
Alois P. Heinz and Ray Chandler, Table of n, a(n) for n = 1..1000 (first 200 terms from Alois P. Heinz)
FORMULA
a(n) = A215222(A000040(n)).
EXAMPLE
a(3) = 1: prime(3) = 5 = 3+2.
a(4) = 1: prime(4) = 7 = 5+2.
a(5) = 1: prime(5) = 11 = 7+5-3+2.
a(6) = 5: prime(6) = 13 = 7+5+3-2 = 11+2 = 11+5-3 = 11+7-3-2 = 11+7-5.
a(7) = 11: prime(7) = 17 = 7+5+3+2 = 11+5+3-2 = 11+7-3+2 = 13+5-3+2 = 13+7-3 = 13+7-5+2 = 13-11+7+5+3 = 13+11-5-2 = 13+11-7 = 13+11-7-5+3+2 = 13+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(ithprime(n), n-1):
seq(a(n), n=1..40);
MATHEMATICA
nmax = 40; d = {1}; a1 = {};
Do[
p = Prime[n];
i = Ceiling[Length[d]/2] + p;
AppendTo[a1, If[i > Length[d], 0, d[[i]]]];
d = PadLeft[d, Length[d] + 2 p] + PadRight[d, Length[d] + 2 p] +
PadLeft[PadRight[d, Length[d] + p], Length[d] + 2 p];
, {n, nmax}];
a1 (* Ray Chandler, Mar 11 2014 *)
CROSSREFS
Sequence in context: A048655 A181896 A041671 * A203160 A095053 A291279
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 24 11:36 EDT 2024. Contains 371936 sequences. (Running on oeis4.)