login
a(n) = 2*a(n-1) + a(n-2); a(0)=1, a(1)=4.
33

%I #85 Jan 13 2024 00:37:28

%S 1,4,9,22,53,128,309,746,1801,4348,10497,25342,61181,147704,356589,

%T 860882,2078353,5017588,12113529,29244646,70602821,170450288,

%U 411503397,993457082,2398417561,5790292204

%N a(n) = 2*a(n-1) + a(n-2); a(0)=1, a(1)=4.

%C Generalized Pellian with second term equal to 4.

%C The generalized Pellian with second term equal to s has the terms a(n) = A000129(n)*s + A000129(n-1). The generating function is -(1+s*x-2*x)/(-1+2*x+x^2). - _R. J. Mathar_, Nov 22 2007

%H T. D. Noe, <a href="/A048654/b048654.txt">Table of n, a(n) for n = 0..300</a>

%H Andreas M. Hinz and Paul K. Stockmeyer, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL25/Hinz/hinz5.html">Precious Metal Sequences and Sierpinski-Type Graphs</a>, J. Integer Seq., Vol 25 (2022), Article 22.4.8.

%H A. F. Horadam, <a href="http://www.fq.math.ca/Scanned/9-3/horadam-a.pdf">Pell Identities</a>, Fib. Quart., Vol. 9, No. 3, 1971, pp. 245-252.

%H A. F. Horadam, <a href="http://www.fq.math.ca/Scanned/3-3/horadam.pdf">Basic Properties of a Certain Generalized Sequence of Numbers</a>, Fibonacci Quarterly, Vol. 3, No. 3, 1965, pp. 161-176.

%H A. F. Horadam, <a href="http://www.fq.math.ca/Scanned/5-5/horadam.pdf">Special properties of the sequence W_n(a,b; p,q)</a>, Fib. Quart., 5.5 (1967), 424-434.

%H Tanya Khovanova, <a href="http://www.tanyakhovanova.com/RecursiveSequences/RecursiveSequences.html">Recursive Sequences</a>

%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (2,1).

%F a(n) = ((3+sqrt(2))*(1+sqrt(2))^n - (3-sqrt(2))*(1-sqrt(2))^n)/2*sqrt(2).

%F a(n) = 2*A000129(n+2) - 3*A000129(n+1). - _Creighton Dement_, Oct 27 2004

%F G.f.: (1+2*x)/(1-2*x-x^2). - _Philippe Deléham_, Nov 03 2008

%F a(n) = binomial transform of 1, 3, 2, 6, 4, 12, ... . - Al Hakanson (hawkuu(AT)gmail.com), Aug 08 2009

%F E.g.f.: exp(x)*cosh(sqrt(2)*x) + 3*exp(x)*sinh(sqrt(2)*x)/sqrt(2). - _Vaclav Kotesovec_, Feb 16 2015

%F a(n) is the denominator of the continued fraction [4, 2, ..., 2, 4] with n-1 2's in the middle. For the numerators, see A221174. - _Greg Dresden_ and _Tongjia Rao_, Sep 02 2021

%F a(n) = A001333(n) + A000129(n). - _G. C. Greubel_, Aug 09 2022

%t LinearRecurrence[{2,1},{1,4},30] (* _Harvey P. Dale_, Jul 27 2011 *)

%o (Haskell)

%o a048654 n = a048654_list !! n

%o a048654_list =

%o 1 : 4 : zipWith (+) a048654_list (map (* 2) $ tail a048654_list)

%o -- _Reinhard Zumkeller_, Aug 01 2011

%o (Maxima)

%o a[0]:1$

%o a[1]:4$

%o a[n]:=2*a[n-1]+a[n-2]$

%o A048654(n):=a[n]$

%o makelist(A048654(n),n,0,30); /* _Martin Ettl_, Nov 03 2012 */

%o (PARI) a(n)=(([0, 1; 1,2]^n)*[1,4]~)[1] \\ _Charles R Greathouse IV_, May 18 2015

%o (Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!((1+2*x)/(1-2*x-x^2))); // _G. C. Greubel_, Jul 26 2018

%o (SageMath) [lucas_number1(n+1,2,-1) +2*lucas_number1(n,2,-1) for n in (0..40)] # _G. C. Greubel_, Aug 09 2022

%Y Cf. A000129, A001333, A048655, A038761, A084214, A100525.

%K easy,nice,nonn

%O 0,2

%A _Barry E. Williams_