OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
W. Bosma, Signed bits and fast exponentiation, J. Th. des Nombres de Bordeaux Vol.13, Fasc. 1, 2001.
Index entries for linear recurrences with constant coefficients, signature (5,-7,-1,8,-4).
FORMULA
a(n) = (n - 2/3)*2^(n) - n/2 + 3/4 - (-1)^n/12.
G.f.: x*(1-2*x^3)/(1+x)/((2*x-1)^2*(x-1)^2). - Maksym Voznyy (voznyy(AT)mail.ru), Aug 14 2009 [checked and corrected by R. J. Mathar, Sep 16 2009]
MATHEMATICA
Table[(n-2/3)*2^n -n/2 +3/4 -(-1)^n/12, {n, 1, 50}]
LinearRecurrence[{5, -7, -1, 8, -4}, {1, 5, 18, 52, 137}, 50] (* G. C. Greubel, May 08 2018 *)
PROG
(PARI) for(n=1, 50, print1((n-2/3)*2^n -n/2 +3/4 -(-1)^n/12, ", ")) \\ G. C. Greubel, May 08 2018
(Magma) [(n-2/3)*2^n -n/2 +3/4 -(-1)^n/12: n in [1..50]]; // G. C. Greubel, May 08 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Artur Jasinski, Feb 09 2007
STATUS
approved