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.

Showing 1-1 of 1 results.

A166117 a(0)=0, a(1)=1, a(2)=2 and a(n) = a(n-1) - 2a(n-2) + a(n-3).

Original entry on oeis.org

0, 1, 2, 0, -3, -1, 5, 4, -7, -10, 8, 21, -5, -39, -8, 65, 42, -96, -115, 119, 253, -100, -487, -34, 840, 421, -1293, -1295, 1712, 3009, -1710, -6016, 413, 10735, 3893, -17164, -14215, 24006, 35272, -26955, -73493, 15689, 135720, 30849, -224902
Offset: 0

Views

Author

Barry Wells (wells.barry(AT)gmail.com), Oct 06 2009

Keywords

Examples

			a(0)=0, a(1)=1, a(2)=2, a(3) = 2-2(1)+0 = 0, a(4)= 0-2(2)+ 1 = -3, a(5) = -3 -2(0) + 2 = -1, a(6)= -1 -2(-3)+ 0 = 5.
		

Crossrefs

Cf. A078051.

Programs

  • Maple
    a:= proc(n) a(n):=`if`(n<3, n, a(n-1)-2*a(n-2)+a(n-3)) end:
    seq(a(n), n=0..50);  # Alois P. Heinz, Sep 30 2013
  • Mathematica
    LinearRecurrence[{1, -2, 1}, {0, 1, 2}, 10] (* G. C. Greubel, Apr 26 2016 *)

Formula

a(n) = n for n<3, else a(n) = a(n-1) - 2*a(n-2) + a(n-3).
G.f.: -(x+1)*x/(x^3-2*x^2+x-1). - Alois P. Heinz, Sep 30 2013
a(n) = (-1)^(1+n)*A078051(n-1). - R. J. Mathar, Feb 05 2016
Showing 1-1 of 1 results.