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 A113042 #25 Jan 30 2024 08:22:57 %S A113042 0,2,1,7,15,45,139,438,1419,4703,16019,55146,190254,671215,2404179, %T A113042 8534995,30635448,110495549,401418693,1467388464,5393131894, %U A113042 19883104535,73856058401,273600682457,1017557492609,3803885439979,14266466901249,53564801078049 %N A113042 Number of solutions to +-p(1)+-p(2)+-...+-p(2n) = 3 where p(i) is the i-th prime. %C A113042 +-p(1)+-p(2)+-...+-p(2n+1) = 3 does not have solutions, since the left hand side is even. [Corrected and edited by _M. F. Hasler_, Aug 09 2015] %H A113042 Ray Chandler, <a href="/A113042/b113042.txt">Table of n, a(n) for n = 1..1000</a> (first 120 terms from Alois P. Heinz) %F A113042 a(n) = [x^3] Product_{k=1..2*n} (x^prime(k) + 1/x^prime(k)). - _Ilya Gutkovskiy_, Jan 30 2024 %p A113042 A113042:=proc(n) local i,j,p,t; t:= NULL; for j from 2 to 2*n by 2 do p:=1; for i to j do p:=p*(x^(-ithprime(i))+x^(ithprime(i))); od; t:=t,coeff(p,x,3); od; t; end; %p A113042 # second Maple program %p A113042 sp:= proc(n) sp(n):= `if`(n=0, 0, ithprime(n)+sp(n-1)) end: %p A113042 b := proc(n, i) option remember; `if`(n>sp(i), 0, `if`(i=0, 1, %p A113042 b(n+ithprime(i), i-1)+ b(abs(n-ithprime(i)), i-1))) %p A113042 end: %p A113042 a:= n-> b(3, 2*n): %p A113042 seq(a(n), n=1..30); # _Alois P. Heinz_, Aug 05 2012 %t A113042 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 + Prime[i], i-1] + b[Abs[n - Prime[i]], i-1]]]; a[n_] := b[3, 2*n]; Table[a[n], {n, 1, 30}] (* _Jean-François Alcover_, Jan 31 2017, after _Alois P. Heinz_ *) %Y A113042 Cf. A022894 - A022904, A022920, A083309; A261061 - A261063 and A261045 (r.h.s. = -1); A261057, A261059, A261060 and A261044 (r.h.s. = -2); A113040, A113041. %K A113042 nonn %O A113042 1,2 %A A113042 _Floor van Lamoen_, Oct 12 2005