The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A022897 Number of solutions to c(1)*prime(2) +...+ c(n)*prime(n+1) = 0, where c(i) = +-1 for i > 1, c(1) = 1. 5
0, 0, 0, 0, 0, 1, 0, 2, 0, 7, 0, 19, 0, 63, 0, 197, 0, 645, 0, 2172, 0, 7423, 0, 25534, 0, 89218, 0, 317284, 0, 1130526, 0, 4033648, 0, 14515742, 0, 52625952, 0, 191790090, 0, 702333340, 0, 2585539586, 0, 9570549372, 0, 35562602950, 0, 131774529663, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,8
LINKS
FORMULA
a(2n-1) = 0 (odd number of odd terms on the l.h.s.); a(2n) = A083309(n). - M. F. Hasler, Aug 08 2015
a(n) = [x^3] Product_{k=3..n+1} (x^prime(k) + 1/x^prime(k)). - Ilya Gutkovskiy, Jan 26 2024
EXAMPLE
a(8) counts these 2 solutions: {3, 5, -7, 11, 13, 17, -19, -23}, {3, 5, 7, 11, -13, -17, -19, 23}. - Clark Kimberling, Oct 01 2013
MATHEMATICA
Table[ps = Prime[Range[2, n+1]]; pr = Inner[Times, 2 IntegerDigits[Range[2^(n-1), 2^n - 1], 2, n] - 1, ps, Plus]; Count[pr, 0], {n, 16}] (* T. D. Noe, Sep 30 2013 *)
PROG
(PARI) padbin(n, len) = {if (n, b = binary(n), b = [0]); while(length(b) < len, b = concat(0, b); ); b; }
a(n) = {nbs = 0; for (i = 2^(n-1), 2^n-1, vec = padbin(i, n); if (sum(k=1, n, if (vec[k], prime(k+1), -prime(k+1))) == 0, nbs++); ); nbs; } \\ Michel Marcus, Sep 30 2013
(PARI) A022897(n, rhs=0, firstprime=2)={rhs-=prime(firstprime); my(p=vector(n-1, i, prime(i+firstprime))); sum(i=1, 2^#p-1, sum(j=1, #p, (-1)^bittest(i, j-1)*p[j])==rhs)} \\ For illustrative purpose, too slow for n >> 20. - M. F. Hasler, Aug 08 2015
(PARI) a(n, s=0-3, p=2)=if(n<=s, if(s==p, n==s, a(abs(n-p), s-p, precprime(p-1))+a(n+p, s-p, precprime(p-1))), if(s<=0, a(abs(s), sum(i=p+1, p+n-1, prime(i)), prime(p+n-1)))) \\ M. F. Hasler, Aug 09 2015
CROSSREFS
Cf. A083309 (without odd n).
Cf. A022894 (use all primes in the sum), A022895 (r.h.s. = 1), A022896 (r.h.s. = 2),..., A022903 (using primes >= 7), A022904, A022920; A261061 - A261063 and A261045 (r.h.s. = -1); A261057, A261059, A261060, A261044 (r.h.s. = -2).
Sequence in context: A363891 A142709 A266220 * A192496 A156442 A268683
KEYWORD
nonn
AUTHOR
EXTENSIONS
a(20)-a(24) from Michel Marcus, Sep 30 2013
More terms from T. D. Noe, Sep 30 2013
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 May 16 03:14 EDT 2024. Contains 372549 sequences. (Running on oeis4.)