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.

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

Original entry on oeis.org

0, 0, 0, 1, 2, 5, 32, 93, 261, 1082, 3253, 12307, 40809, 153392, 525417, 1892876, 6847161, 25256461, 91268129, 335852960, 1239350769, 4606651034, 17073491494, 63523866957, 237953442636, 892247156886, 3346127378391, 12603121634857, 47642071407103
Offset: 1

Views

Author

M. F. Hasler, Aug 08 2015

Keywords

Comments

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

Crossrefs

Cf. A261057 (starting with prime(1)), A261059 (starting with prime(2)), A261060 (starting with prime(3)), A261061 - A261063 and A261044 (r.h.s. = -1), A022894 -A022904, A083309, A022920 (r.h.s. = 0, 1 or 2).

Programs

  • Maple
    s:= proc(n) option remember;
          `if`(n<5, 0, ithprime(n)+s(n-1))
        end:
    b:= proc(n, i) option remember; `if`(n>s(i), 0, `if`(i=4, 1,
          b(abs(n-ithprime(i)),i-1)+b(n+ithprime(i),i-1)))
        end:
    a:= n-> b(8, 2*n+2):
    seq(a(n), n=1..30);  # Alois P. Heinz, Aug 08 2015
  • Mathematica
    s[n_] := s[n] = If[n<5, 0, Prime[n]+s[n-1]]; b[n_, i_] := b[n, i] = If[n > s[i], 0, If[i == 4, 1, b[Abs[n-Prime[i]], i-1] + b[n+Prime[i], i-1]]]; a[n_] := b[8, 2*n+2]; Table[a[n], {n, 1, 30}] (* Jean-François Alcover, Nov 11 2015, after Alois P. Heinz *)
  • PARI
    a(n)={my(p=vector(2*n-2,i,prime(i+4)));sum(i=1,2^(2*n-2),sum(j=1,#p,(1-bittest(i,j-1)<<1)*p[j],7)==-1)} \\ For illustrative purpose; too slow for n >> 10. - M. F. Hasler, Aug 08 2015

Extensions

a(13)-a(29) from Alois P. Heinz, Aug 08 2015