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

%I #25 Feb 14 2018 21:10:27

%S 0,0,0,0,0,0,0,1,0,7,0,12,0,61,0,131,0,472,0,2039,0,5924,0,21095,0,

%T 76058,0,274023,0,1032989,0,3694643,0,12987172,0,48417270,0,174274092,

%U 0,642785629,0,2402825962,0,8918414212,0,32868915523,0,123145191037,0

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

%C Each second entry is 0 because the primes that are involved are all odd and the right hand side is even. - _R. J. Mathar_, Aug 06 2015

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

%F a(2n-1) = 0 for all n >= 1.

%t b[n_, s_, p_] := b[n, s, p] = If[n <= s, If[s == p, Boole[n == s], b[Abs[n - p], s - p, NextPrime[p - 1, -1]] + b[n + p, s - p, NextPrime[p - 1, -1] ]], If[s <= 0, b[Abs[s], Sum[Prime[i], {i, p + 1, p + n - 1}], Prime[p + n - 1]]]] /. Null -> 0; a[n_] := b[n, 2 - Prime[4], 4]; Array[a, 50] (* _Jean-François Alcover_, Feb 14 2018, after _M. F. Hasler_ *)

%o (PARI) A022920(n)={my(p=vector(n-1,i,prime(i+4)));sum(i=1,2^(n-1),sum(j=1,#p,(1-bittest(i,j-1)<<1)*p[j],7)==2)} \\ For illustrative purpose; too slow for n >> 20. - _M. F. Hasler_, Aug 08 2015

%o (PARI) a(n, s=2-prime(4), p=4)=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. A022894, A022895, A022896 (r.h.s. = 0, 1 & 2, using all primes), A083309 and A022897 - A022899 (using primes >= 3), A022900 - A022902 (using primes >=5), A022903, A022904 (r.h.s. = 0 & 1, using primes >= 7); A261061 - A261063 & A261045 (r.h.s. = -1); A261057, A261059, A261060 & A261044 (r.h.s. = -2).

%K nonn

%O 1,10

%A _Clark Kimberling_

%E Corrected by _R. J. Mathar_, Aug 06 2015

%E a(22)-a(49) from _Alois P. Heinz_, Aug 06 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 March 29 02:23 EDT 2024. Contains 371264 sequences. (Running on oeis4.)