login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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
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, 76058, 0, 274023, 0, 1032989, 0, 3694643, 0, 12987172, 0, 48417270, 0, 174274092, 0, 642785629, 0, 2402825962, 0, 8918414212, 0, 32868915523, 0, 123145191037, 0
OFFSET
1,10
COMMENTS
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
LINKS
FORMULA
a(2n-1) = 0 for all n >= 1.
MATHEMATICA
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 *)
PROG
(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
(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
CROSSREFS
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).
Sequence in context: A122699 A262807 A169603 * A331423 A240825 A243773
KEYWORD
nonn
EXTENSIONS
Corrected by R. J. Mathar, Aug 06 2015
a(22)-a(49) from Alois P. Heinz, Aug 06 2015
STATUS
approved