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!)
A261062 Number of solutions to c(1)*prime(2) + ... + c(2n-1)*prime(2n) = -1, where c(i) = +-1 for i > 1, c(1) = 1. 3

%I #16 Jan 31 2024 14:17:40

%S 0,0,1,0,6,8,30,121,385,1102,4207,13263,48904,164298,610450,2108897,

%T 7592564,27444148,100851443,365507140,1344593522,4960584613,

%U 18435632285,68320148701,254166868115,951593812462,3568369245595,13386056545363,50416752718382

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

%C There cannot be a solution for an even number of terms on the l.h.s. because all terms are odd but the r.h.s. is odd, too.

%H Alois P. Heinz, <a href="/A261062/b261062.txt">Table of n, a(n) for n = 1..300</a>

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

%e a(1) = a(2) = 0 because prime(2) and prime(2) +- prime(3) +- prime(4) are always different from -1.

%e a(3) = 1 because the solution prime(2) + prime(3) - prime(4) + prime(5) - prime(6) = -1 is the only one involving prime(2) through prime(6).

%p s:= proc(n) option remember;

%p `if`(n<3, 0, ithprime(n)+s(n-1))

%p end:

%p b:= proc(n, i) option remember; `if`(n>s(i), 0, `if`(i=2, 1,

%p b(abs(n-ithprime(i)), i-1)+b(n+ithprime(i), i-1)))

%p end:

%p a:= n-> b(4, 2*n):

%p seq(a(n), n=1..30); # _Alois P. Heinz_, Aug 08 2015

%t s[n_] := s[n] = If[n < 3, 0, Prime[n] + s[n-1]];

%t b[n_, i_] := b[n, i] = If[n > s[i], 0, If[i == 2, 1, b[Abs[n-Prime[i]], i-1] + b[n+Prime[i], i-1]]];

%t a[n_] := b[4, 2n];

%t Array[a, 30] (* _Jean-François Alcover_, Nov 07 2020, after _Alois P. Heinz_ *)

%o (PARI) A261062(n,rhs=-1,firstprime=2)={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 Cf. A261061, A261063 and A261044 (starting with prime(1), prime(3) and prime(4)), A022894, ..., A022904, A022920, A083309 (r.h.s. = 0, 1 or 2), A261057, A261059, A261060, A261045 (r.h.s. = -2).

%K nonn

%O 1,5

%A _M. F. Hasler_, Aug 08 2015

%E a(14)-a(29) from _Alois P. Heinz_, Aug 08 2015

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 April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)