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.

A079757 Periodic sequence 1, 0, -2, 3, -2, 0, ...

Original entry on oeis.org

1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0
Offset: 0

Views

Author

Mario Catalani (mario.catalani(AT)unito.it), Jan 10 2003

Keywords

Crossrefs

Cf. A057079.

Programs

  • Magma
    &cat[[1,0,-2,3,-2,0]: n in [0..20]]; // G. C. Greubel, Mar 27 2024
    
  • Mathematica
    PadRight[{}, 120, {1,0,-2,3,-2,0}] (* G. C. Greubel, Mar 27 2024 *)
  • SageMath
    def A079757(n): return [1,0,-2,3,-2,0][n%6]
    [A079757(n) for n in range(121)] # G. C. Greubel, Mar 27 2024

Formula

a(n) = A057079(2*n+1) - (-1)^floor((2*n+1)/2).
G.f.: (1+2*x)/(1+2*x+2*x^2+x^3).
a(n) = -2*a(n-1) - 2*a(n-2) - a(n-3).
a(n) = |Real(2*(sqrt(3/4)*i - 1/2)^n - (-1)^n )|, where i = sqrt(-1). - Ralf Stephan, Mar 07 2003