This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A022897 #28 Dec 29 2024 08:49:46 %S A022897 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 A022897 89218,0,317284,0,1130526,0,4033648,0,14515742,0,52625952,0,191790090, %U A022897 0,702333340,0,2585539586,0,9570549372,0,35562602950,0,131774529663,0 %N 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. %H A022897 Alois P. Heinz, <a href="/A022897/b022897.txt">Table of n, a(n) for n = 1..500</a> %F A022897 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 A022897 a(n) = [x^3] Product_{k=3..n+1} (x^prime(k) + 1/x^prime(k)). - _Ilya Gutkovskiy_, Jan 26 2024 %e A022897 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 A022897 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 A022897 (PARI) padbin(n, len) = {if (n, b = binary(n), b = [0]); while(length(b) < len, b = concat(0, b);); b;} %o A022897 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 A022897 (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 A022897 (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 A022897 Cf. A083309 (without odd n). %Y A022897 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 A022897 nonn %O A022897 1,8 %A A022897 _Clark Kimberling_ %E A022897 a(20)-a(24) from _Michel Marcus_, Sep 30 2013 %E A022897 More terms from _T. D. Noe_, Sep 30 2013