OFFSET
0,1
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,0,-1)
FORMULA
From R. J. Mathar, Mar 11 2011: (Start)
a(n+1) - a(n) = A156279(n).
G.f.: (3 + 5*x - 7*x^2) / ((x - 1)*(x^2 + x - 1)).
(End)
a(n) = A156279(n+1) - 1. - Bruno Berselli, Jul 27 2017
From Colin Barker, Jul 27 2017: (Start)
a(n) = 2^(-n)*(-2^n + 2*(1-sqrt(5))^(1+n) + 2*(1+sqrt(5))^(1+n)).
a(n) = 2*a(n-1) - a(n-3) for n>2.
(End)
MATHEMATICA
LinearRecurrence[{2, 0, -1}, {3, 11, 15}, 40] (* Bruno Berselli, Jul 27 2017 *)
PROG
(Python)
from sympy import lucas
def a(n): return 4 * lucas(n + 1) - 1
print([a(n) for n in range(51)]) # Indranil Ghosh, Jul 27 2017
(PARI) Vec((3+5*x-7*x^2)/((x-1)*(x^2+x-1)) + O(x^50)) \\ Colin Barker, Jul 27 2017
(Magma) m:=30; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((3+5*x-7*x^2)/((x-1)*(x^2+x-1)))); // G. C. Greubel, Feb 28 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved