OFFSET
0,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000 (corrected by Ray Chandler, Jan 19 2019)
Wieb Bosma, Signed bits and fast exponentiation, J. Th. Nombres de Bordeaux, 13 no. 1 (2001), p. 27-41.
Index entries for linear recurrences with constant coefficients, signature (4,-3,-4,4).
FORMULA
a(n) = (n/3 + 4/9)*2^n - 1/2 + (-1)^n/18.
a(1)=1, a(2)=4, a(3)=11, a(4)=28, a(n) = 4*a(n-1)-3*a(n-2)-4*a(n-3)+4*a(n-4). - Harvey P. Dale, May 15 2011
G.f.: x*(1-2*x^2)/((1-2*x)^2*(1-x^2)). - Harvey P. Dale, May 15 2011
E.g.f.: ((4 + 6*x)*cosh(2*x) - 5*sinh(x) + 4*cosh(x)*((2 + 3*x)*sinh(x) - 1))/9. - Stefano Spezia, May 25 2023
MATHEMATICA
Table[(n/3 + 4/9) 2^n - 1/2 + (-1)^n/18, {n, 1, 50}]
LinearRecurrence[{4, -3, -4, 4}, {1, 4, 11, 28}, 50] (* Harvey P. Dale, May 15 2011 *)
PROG
(Magma) [(n/3 + 4/9)*2^n - 1/2 + (-1)^n/18: n in [1..40]]; // Vincenzo Librandi, May 26 2011
(PARI) a(n)=(n*3+4)<<n\9 \\ M. F. Hasler, Oct 07 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Artur Jasinski, Feb 09 2007
EXTENSIONS
Definition simplified by M. F. Hasler, Oct 07 2014
Sequence extended to a(0)=0 by M. F. Hasler, Oct 08 2014
STATUS
approved