cp's OEIS Frontend

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.

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

This page as a plain text file.
%I A261061 #18 Jan 31 2024 14:11:44
%S A261061 1,0,2,3,8,23,68,221,709,2344,8006,27585,95114,335645,1202053,4267640,
%T A261061 15317698,55248527,200711160,733697248,2696576651,9941588060,
%U A261061 36928160817,136800727634,508780005068,1901946851732,7133247301621,26782446410398,100862459737318
%N A261061 Number of solutions to c(1)*prime(1)+...+c(2n)*prime(2n) = -1, where c(i) = +-1 for i > 1, c(1) = 1.
%C A261061 There cannot be a solution for an odd number of terms on the l.h.s. because there would be an even number of odd terms but the r.h.s. is odd.
%H A261061 Alois P. Heinz, <a href="/A261061/b261061.txt">Table of n, a(n) for n = 1..300</a>
%F A261061 Conjecture: limit_{n->infinity} a(n)^(1/n) = 4. - _Vaclav Kotesovec_, Jun 05 2019
%F A261061 a(n) = [x^3] Product_{k=2..2*n} (x^prime(k) + 1/x^prime(k)). - _Ilya Gutkovskiy_, Jan 31 2024
%e A261061 a(1) = 1 counts the solution prime(1) - prime(2) = -1.
%e A261061 a(2) = 0 because prime(1) +- prime(2) +- prime(3) +- prime(4) is always different from -1.
%e A261061 a(3) = 2 counts the two solutions prime(1) - prime(2) + prime(3) - prime(4) - prime(5) + prime(6) = -1 and prime(1) - prime(2) - prime(3) + prime(4) + prime(5) - prime(6) = -1.
%p A261061 s:= proc(n) option remember;
%p A261061       `if`(n<2, 0, ithprime(n)+s(n-1))
%p A261061     end:
%p A261061 b:= proc(n, i) option remember; `if`(n>s(i), 0, `if`(i=1, 1,
%p A261061       b(abs(n-ithprime(i)), i-1)+b(n+ithprime(i), i-1)))
%p A261061     end:
%p A261061 a:= n-> b(3, 2*n):
%p A261061 seq(a(n), n=1..30);  # _Alois P. Heinz_, Aug 08 2015
%t A261061 s[n_] := s[n] = If[n<2, 0, Prime[n]+s[n-1]]; b[n_, i_] := b[n, i] = If[n > s[i], 0, If[i == 1, 1, b[Abs[n-Prime[i]], i-1] + b[n+Prime[i], i-1]]]; a[n_] := b[3, 2*n]; Table[a[n], {n, 1, 30}] (* _Jean-François Alcover_, Nov 11 2015, after _Alois P. Heinz_ *)
%o A261061 (PARI) A261061(n,rhs=-1,firstprime=1)={rhs-=prime(firstprime);my(p=vector(2*n-2+bittest(rhs,0),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 >> 10.
%Y A261061 Cf. A261062 - A261063 and A261044 (starting with prime(2), prime(3) resp. prime(4)), A022894 - A022904, A083309, A022920 (r.h.s. = 0, 1 or 2), A261057, A261059, A261060, A261045 (r.h.s. = -2).
%K A261061 nonn
%O A261061 1,3
%A A261061 _M. F. Hasler_, Aug 08 2015
%E A261061 a(14)-a(29) from _Alois P. Heinz_, Aug 08 2015