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

%I #25 Jan 27 2024 20:27:14

%S 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,

%T 89218,0,317284,0,1130526,0,4033648,0,14515742,0,52625952,0,191790090,

%U 0,702333340,0,2585539586,0,9570549372,0,35562602950,0,131774529663,0

%N Number of solutions to c(1)*prime(2) +...+ c(n)*prime(n+1) = 0, where c(i) = +-1 for i > 1, c(1) = 1.

%H Alois P. Heinz, <a href="/A022897/b022897.txt">Table of n, a(n) for n = 1..500</a>

%F a(2n-1) = 0 (odd number of odd terms on the l.h.s.); a(2n) = A083309(n). - _M. F. Hasler_, Aug 08 2015

%F a(n) = [x^3] Product_{k=3..n+1} (x^prime(k) + 1/x^prime(k)). - _Ilya Gutkovskiy_, Jan 26 2024

%e 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

%t 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 *)

%o (PARI) padbin(n, len) = {if (n, b = binary(n), b = [0]); while(length(b) < len, b = concat(0, b);); b;}

%o 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

%o (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

%o (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

%Y Cf. A083309 (without odd n).

%Y 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).

%K nonn

%O 1,8

%A _Clark Kimberling_

%E a(20)-a(24) from _Michel Marcus_, Sep 30 2013

%E More terms from _T. D. Noe_, Sep 30 2013

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 June 11 22:48 EDT 2024. Contains 373317 sequences. (Running on oeis4.)