cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

1, 4, 9, 22, 53, 128, 309, 746, 1801, 4348, 10497, 25342, 61181, 147704, 356589, 860882, 2078353, 5017588, 12113529, 29244646, 70602821, 170450288, 411503397, 993457082, 2398417561, 5790292204
Offset: 0

Views

Author

Keywords

Comments

Generalized Pellian with second term equal to 4.
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

Crossrefs

Programs

  • Haskell
    a048654 n = a048654_list !! n
    a048654_list =
       1 : 4 : zipWith (+) a048654_list (map (* 2) $ tail a048654_list)
    -- Reinhard Zumkeller, Aug 01 2011
    
  • Magma
    R:=PowerSeriesRing(Integers(), 40); Coefficients(R!((1+2*x)/(1-2*x-x^2))); // G. C. Greubel, Jul 26 2018
    
  • Mathematica
    LinearRecurrence[{2,1},{1,4},30] (* Harvey P. Dale, Jul 27 2011 *)
  • Maxima
    a[0]:1$
    a[1]:4$
    a[n]:=2*a[n-1]+a[n-2]$
    A048654(n):=a[n]$
    makelist(A048654(n),n,0,30); /* Martin Ettl, Nov 03 2012 */
    
  • PARI
    a(n)=(([0, 1; 1,2]^n)*[1,4]~)[1] \\ Charles R Greathouse IV, May 18 2015
    
  • SageMath
    [lucas_number1(n+1,2,-1) +2*lucas_number1(n,2,-1) for n in (0..40)] # G. C. Greubel, Aug 09 2022

Formula

a(n) = ((3+sqrt(2))*(1+sqrt(2))^n - (3-sqrt(2))*(1-sqrt(2))^n)/2*sqrt(2).
a(n) = 2*A000129(n+2) - 3*A000129(n+1). - Creighton Dement, Oct 27 2004
G.f.: (1+2*x)/(1-2*x-x^2). - Philippe Deléham, Nov 03 2008
a(n) = binomial transform of 1, 3, 2, 6, 4, 12, ... . - Al Hakanson (hawkuu(AT)gmail.com), Aug 08 2009
E.g.f.: exp(x)*cosh(sqrt(2)*x) + 3*exp(x)*sinh(sqrt(2)*x)/sqrt(2). - Vaclav Kotesovec, Feb 16 2015
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
a(n) = A001333(n) + A000129(n). - G. C. Greubel, Aug 09 2022