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.

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.

Original entry on oeis.org

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

Views

Author

Keywords

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

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).

Programs

  • 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 *)
  • 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

Formula

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

Extensions

Corrected by R. J. Mathar, Aug 06 2015
a(22)-a(49) from Alois P. Heinz, Aug 06 2015