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.

A112455 a(n) = -a(n-2) - a(n-3).

Original entry on oeis.org

-3, 0, 2, 3, -2, -5, -1, 7, 6, -6, -13, 0, 19, 13, -19, -32, 6, 51, 26, -57, -77, 31, 134, 46, -165, -180, 119, 345, 61, -464, -406, 403, 870, 3, -1273, -873, 1270, 2146, -397, -3416, -1749, 3813, 5165, -2064, -8978, -3101, 11042, 12079, -7941
Offset: 0

Views

Author

Anthony C Robin, Dec 13 2005

Keywords

Comments

This sequence resembles the Perrin sequence, A001608. Like many such sequences with a(1)=0, any prime p divides a(p). The first pseudoprime (composite n divides a(n)) is 121.

Crossrefs

Programs

  • GAP
    a:=[-3,0,2];; for n in [4..60] do a[n]:=-a[n-2]-a[n-3]; od; a; # G. C. Greubel, May 19 2019
  • Magma
    I:=[-3,0,2]; [n le 3 select I[n] else -Self(n-2) -Self(n-3): n in [1..60]]; // G. C. Greubel, May 19 2019
    
  • Maple
    A112455 := proc(n)
        option remember ;
        if n <= 2 then
            op(n+1,[-3,0,2]) ;
        else
            -procname(n-2)-procname(n-3) ;
        end if;
    end proc: # R. J. Mathar, Feb 18 2024
  • Mathematica
    Table[ -Tr[MatrixPower[{{0, 0, -1}, {1, 0, -1}, {0, 1, 0}}, n]], {n, 1, 60}] (* Artur Jasinski, Jan 10 2007 *)
    LinearRecurrence[{0,-1,-1}, {-3,0,2}, 60] (* G. C. Greubel, May 19 2019 *)
  • PARI
    Vec(-(3+x^2)/(1+x^2+x^3)+O(x^60)) \\ Charles R Greathouse IV, May 15 2013
    
  • Sage
    (-(3+x^2)/(1+x^2+x^3)).series(x, 60).coefficients(x, sparse=False) # G. C. Greubel, May 19 2019
    

Formula

a(n) = - trace({{0, 0, -1}, {1, 0, -1}, {0, 1, 0}})^n. - Artur Jasinski, Jan 10 2007
From R. J. Mathar, Oct 24 2009: (Start)
G.f.: -(3+x^2)/(1+x^2+x^3).
a(n) = -3*A077962(n) - A077962(n-2). (End)
a(n) = (-1)^(n+1)*(A001609(n)^2 - A001609(2*n))/2. - Greg Dresden, Apr 14 2023

Extensions

Edited by Don Reble, Jan 25 2006