OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
W. Bosma, Signed bits and fast exponentiation, Journal de Théorie des Nombres de Bordeaux, Vol. 13, Fasc. 1 (2001), p. 37 (Proposition 5).
Index entries for linear recurrences with constant coefficients, signature (2,3,-4,-4).
FORMULA
G.f.: x*(1+2*x-2*x^2-2*x^3)/((1+x)^2*(1-2x)^2). - Bruno Berselli, Apr 02 2012
a(n) = 2*a(n-1)+3*a(n-2)-4*a(n-3)-4*a(n-4). - Wesley Ivan Hurt, May 07 2021
MATHEMATICA
Table[(5n/18 + 19/54)2^(n) - ((-1)^(n - 1) )(3n + 4)/27, {n, 1, 100}]
LinearRecurrence[{2, 3, -4, -4}, {1, 4, 9, 24}, 50] (* G. C. Greubel, May 08 2018 *)
PROG
(PARI) for(n=1, 50, print1((5*n/18 +19/54)*2^n -(-1)^(n-1)*(3*n+4)/27, ", ")) \\ G. C. Greubel, May 08 2018
(Magma) [(5*n/18 +19/54)*2^n -(-1)^(n-1)*(3*n+4)/27: n in [1..50]]; // G. C. Greubel, May 08 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Artur Jasinski, Feb 09 2007
STATUS
approved