OFFSET
0,1
COMMENTS
The continued fraction expansion c_0 = 0, c_n = 1/2 (n>0) (see a paper by Bremner & Tzanakis) has convergents 2/1, 2/5, 10/9, 18/29, 58/65, 130/181, ... where the numerators and denominators satisfy the recurrence a_n = a_{n-1} + 4a_{n-2}. The denominators are A006131 and the numerators are the present sequence.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,4).
FORMULA
a(n) = 2 * A006131(n).
G.f.: Q(0)/x -1/x, where Q(k) = 1 + 4*x^2 + (2*k+3)*x - x*(2*k+1 + 4*x)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Oct 05 2013
G.f.: -2 / ( -1+x+4*x^2 ). - R. J. Mathar, Feb 10 2016
a(n) = (2^(-n)*(-(1-sqrt(17))^(1+n) + (1+sqrt(17))^(1+n)))/sqrt(17). - Colin Barker, Dec 22 2016
MATHEMATICA
a[0] = a[1] = 2; a[n_] := a[n] = a[n - 1] + 4a[n - 2]; Table[ a[n], {n, 0, 27}] (* Robert G. Wilson v, Feb 23 2005 *)
LinearRecurrence[{1, 4}, {2, 2}, 30] (* Vincenzo Librandi, Dec 17 2015 *)
PROG
(Sage) from sage.combinat.sloane_functions import recur_gen2b
it = recur_gen2b(2, 2, 1, 4, lambda n: 0)
[next(it) for i in range(29)] # Zerinvary Lajos, Jul 09 2008
(Sage)
def A000129():
x, y = 0, 1
while True:
x, y = (x + y) << 1, x - y
yield x
a = A000129(); [next(a) for i in range(28)] # Peter Luschny, Dec 17 2015
(Magma) [n le 2 select 2 else Self(n-1) + 4*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Dec 17 2015
(PARI) Vec(-2 / (-1+x+4*x^2) + O(x^40)) \\ Colin Barker, Dec 22 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, based on a suggestion from R. K. Guy, Feb 23 2005
EXTENSIONS
More terms from Robert G. Wilson v, Feb 23 2005
STATUS
approved