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.

A087620 #{0<=k<=n: k*n is divisible by 4}.

Original entry on oeis.org

1, 1, 2, 1, 5, 2, 4, 2, 9, 3, 6, 3, 13, 4, 8, 4, 17, 5, 10, 5, 21, 6, 12, 6, 25, 7, 14, 7, 29, 8, 16, 8, 33, 9, 18, 9, 37, 10, 20, 10, 41, 11, 22, 11, 45, 12, 24, 12, 49, 13, 26, 13, 53, 14, 28, 14, 57, 15, 30, 15, 61, 16, 32, 16, 65, 17, 34, 17, 69, 18, 36, 18, 73, 19, 38, 19, 77, 20
Offset: 0

Views

Author

Paul Barry, Sep 13 2003

Keywords

Comments

With the similar remainder 1, 2 and 3 sequences provides a four-fold partition of A000027.

Crossrefs

Programs

  • Magma
    I:=[1,1,2,1,5,2,4,2]; [n le 8 select I[n] else 2*Self(n-4)-Self(n-8): n in [1..80]]; // Vincenzo Librandi, May 03 2015
  • Mathematica
    CoefficientList[Series[(3 x^4 + x^3 + 2 x^2 + x + 1)/((x - 1)^2 (x + 1)^2 (x^2 + 1)^2), {x, 0, 80}], x] (* Vincenzo Librandi, May 03 2015 *)
  • PARI
    Vec((3*x^4+x^3+2*x^2+x+1)/((x-1)^2*(x+1)^2*(x^2+1)^2) + O(x^100)) \\ Colin Barker, May 03 2015
    

Formula

a(n) = Sum_{k=0..n} if (k*n mod 4 = 0, 1, 0).
From Colin Barker, May 03 2015: (Start)
a(n) = (6+4*n+i^n*(-i+n)+(-i)^n*(i+n)+2*(-1)^n*(1+n))/8 where i=sqrt(-1).
a(n) = 2*a(n-4)-a(n-8) for n>7.
G.f.: (3*x^4+x^3+2*x^2+x+1) / ((x-1)^2*(x+1)^2*(x^2+1)^2).
(End)