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.

A137797 a(n) = 2*( (n+1) mod 5 ) - 2*( (n+1) mod 2 ).

Original entry on oeis.org

0, 4, 4, 8, -2, 2, 2, 6, 6, 0, 0, 4, 4, 8, -2, 2, 2, 6, 6, 0, 0, 4, 4, 8, -2, 2, 2, 6, 6, 0, 0, 4, 4, 8, -2, 2, 2, 6, 6, 0, 0, 4, 4, 8, -2, 2, 2, 6, 6, 0, 0, 4, 4, 8, -2, 2, 2, 6, 6, 0, 0, 4, 4, 8, -2, 2, 2, 6, 6, 0, 0, 4, 4, 8, -2, 2, 2, 6, 6
Offset: 0

Views

Author

William A. Tedeschi, Feb 10 2008

Keywords

Comments

The sequence is periodic with period 10. - Colin Barker, Dec 16 2014

Examples

			a(2) = 2*((2+1) mod 5) - 2*((2+1) mod 2) = 2*(3 mod 5) - 2*(3 mod 2) = 4.
		

Crossrefs

Suggested by A010700. Used in A137798.

Programs

  • Mathematica
    LinearRecurrence[{-1,0,0,0,1,1},{0,4,4,8,-2,2},100] (* Harvey P. Dale, Jun 08 2015 *)
  • PARI
    concat(0, Vec(-2*x*(3*x^3+6*x^2+4*x+2)/((x-1)*(x+1)*(x^4+x^3+x^2+x+1)) + O(x^100))) \\ Colin Barker, Dec 16 2014

Formula

a(n) = -a(n-1)+a(n-5)+a(n-6) for n>5. - Colin Barker, Dec 16 2014
G.f.: -2*x*(3*x^3+6*x^2+4*x+2) / ((x-1)*(x+1)*(x^4+x^3+x^2+x+1)). - Colin Barker, Dec 16 2014