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.

Previous Showing 11-20 of 60 results. Next

A003665 a(n) = 2^(n-1)*( 2^n + (-1)^n ).

Original entry on oeis.org

1, 1, 10, 28, 136, 496, 2080, 8128, 32896, 130816, 524800, 2096128, 8390656, 33550336, 134225920, 536854528, 2147516416, 8589869056, 34359869440, 137438691328, 549756338176, 2199022206976, 8796095119360, 35184367894528, 140737496743936, 562949936644096, 2251799847239680
Offset: 0

Views

Author

Keywords

Comments

Binomial transform of expansion of cosh(3*x), the aerated version of A001019, 1,0,9,0,81,0,729,... - Paul Barry, Apr 05 2003
Alternatively: start with the fraction 1/1, take the numerators of fractions built according to the rule: add top and bottom to get the new bottom, add top and 9 times the bottom to get the new top. The limit of the sequence of fractions used to generate this sequence is sqrt(9). - Cino Hilliard, Sep 25 2005
This sequence also gives the number of ordered pairs of subsets (A, B) of {1, 2, ..., n} such that |A u B| is even. (Here "u" stands for the set-theoretic union.) The special case n = 13 can be found as in CRUX Problem 3257. - Walther Janous (walther.janous(AT)tirol.com), Mar 01 2008
For n > 0, a(n) is term (1,1) in the n-th power of the 2 X 2 matrix [1,3; 3,1]. - Gary W. Adamson, Aug 06 2010
a(n) is the number of compositions of n when there are 1 type of 1 and 9 types of other natural numbers. - Milan Janjic, Aug 13 2010
a(n) = ((1+3)^n+(1-3)^n)/2. In general, if b(0),b(1),... is the k-th binomial transform of the sequence ((3^n+(-3)^n)/2), then b(n) = ((k+3)^n+(k-3)^n)/2. More generally, if b(0),b(1),... is the k-th binomial transform of the sequence ((m^n+(-m)^n)/2), then b(n) = ((k+m)^n+(k-m)^n)/2. See A034494, A081340-A081342, A034659. - Charlie Marion, Jun 25 2011
Pisano period lengths: 1, 1, 1, 1, 4, 1, 6, 1, 1, 4, 5, 1, 12, 6, 4, 1, 8, 1, 9, 4, ... - R. J. Mathar, Aug 10 2012
Starting with offset 1 the sequence is the INVERT transform of (1, 9, 9, 9, ...). - Gary W. Adamson, Aug 06 2016

References

  • John Derbyshire, Prime Obsession, Joseph Henry Press, April 2004, p. 16.
  • M. Gardner, Riddles of Sphinx, M.A.A., 1987, p. 145.

Crossrefs

Programs

  • GAP
    List([0..30], n-> 2^(n-1)*(2^n +(-1)^n)); # G. C. Greubel, Aug 02 2019
  • Magma
    [2^(n-1)*( 2^n + (-1)^n ): n in [0..30]]; // Vincenzo Librandi, Aug 19 2011
    
  • Maple
    A003665:=n->2^(n-1)*( 2^n + (-1)^n ): seq(A003665(n), n=0..30); # Wesley Ivan Hurt, Apr 28 2017
  • Mathematica
    CoefficientList[Series[(1+8x)/(1-2x-8x^2), {x,0,30}], x] (* or *)
    LinearRecurrence[{2,8}, {1,1}, 30] (* Robert G. Wilson v, Sep 18 2013 *)
  • PARI
    a(n)=2^(n-1)*( 2^n + (-1)^n );
    
  • Sage
    [2^(n-1)*(2^n +(-1)^n) for n in (0..30)] # G. C. Greubel, Aug 02 2019
    

Formula

From Paul Barry, Mar 01 2003: (Start)
a(n) = 2*a(n-1) + 8*a(n-2), a(0)=a(1)=1.
a(n) = (4^n + (-2)^n)/2.
G.f.: (1-x)/((1+2*x)*(1-4*x)). (End)
From Paul Barry, Apr 05 2003: (Start)
a(n) = Sum_{k=0..floor(n/2)} binomial(n, 2*k)*9^k.
E.g.f. exp(x)*cosh(3*x). (End)
a(n) = (A078008(n) + A001045(n+1))*2^(n-1) = A014551(n)*2^(n-1). - Paul Barry, Feb 12 2004
Given a(0)=1, b(0)=1 then for i=1, 2, ..., a(i)/b(i) = (a(i-1) + 9*b(i-1)) / (a(i-1) + b(i-1)). - Cino Hilliard, Sep 25 2005
a(n) = Sum_{k=0..n} A098158(n,k)*9^(n-k). - Philippe Deléham, Dec 26 2007
a(n) = ((1+sqrt(9))^n + (1-sqrt(9))^n)/2. - Al Hakanson (hawkuu(AT)gmail.com), Dec 08 2008
If p[1]=1, and p[i]=9, (i>1), and if A is Hessenberg matrix of order n defined by: A[i,j]=p[j-i+1], (i<=j), A[i,j]=-1, (i=j+1), and A[i,j]=0 otherwise. Then, for n>=1, a(n)=det(A). - Milan Janjic, Apr 29 2010
G.f.: G(0)/2, where G(k) = 1 + 1/(1 - x*(9*k-1)/(x*(9*k+8) - 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 28 2013

Extensions

Entry revised by N. J. A. Sloane, Nov 22 2006

A166920 a(n) = 2^n - (1 + (-1)^n)/2.

Original entry on oeis.org

0, 2, 3, 8, 15, 32, 63, 128, 255, 512, 1023, 2048, 4095, 8192, 16383, 32768, 65535, 131072, 262143, 524288, 1048575, 2097152, 4194303, 8388608, 16777215, 33554432, 67108863, 134217728, 268435455, 536870912, 1073741823, 2147483648, 4294967295
Offset: 0

Views

Author

Paul Curtz, Oct 23 2009

Keywords

Comments

Partial sums of A014551. The inverse binomial transform yields a sequence 0,2,-1,5,-7,17,...: zero followed by a sign alternating A014551.
The table of a(n) plus higher order differences in successive rows shows A131577 on the main diagonal.
a(n) = 2^n when n is odd and 2^n-1 when n is even. - Wesley Ivan Hurt, Nov 15 2013

Crossrefs

Programs

Formula

G.f.: x*(2-x)/((1-x)*(1-2*x)*(1+x)).
a(n) = 2^n - (1+(-1)^n)/2.
a(2*n) = A024036(n); a(2*n+1) = A004171(n).
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3).
a(n+1) - 2*a(n) = A168361(n).
a(n) = A000225(n+1) - A051049(n) = A014551(n) - A168361(n).
E.g.f.: exp(2*x) - cosh(x). - G. C. Greubel, May 28 2016
a(n) = Sum_{k=1..n+1} Sum_{i=0..n+1} C(n-k,i). - Wesley Ivan Hurt, Sep 22 2017
a(n) = 2*A001045(n) + A000975(n-1) for n>0. - Yuchun Ji, Aug 30 2018

Extensions

Edited and extended by R. J. Mathar, Mar 02 2010

A075117 Table by antidiagonals of generalized Lucas numbers: T(n,k) = T(n,k-1) + n*T(n,k-2) with T(n,0)=2 and T(n,1)=1.

Original entry on oeis.org

2, 1, 2, 1, 1, 2, 1, 3, 1, 2, 1, 4, 5, 1, 2, 1, 7, 7, 7, 1, 2, 1, 11, 17, 10, 9, 1, 2, 1, 18, 31, 31, 13, 11, 1, 2, 1, 29, 65, 61, 49, 16, 13, 1, 2, 1, 47, 127, 154, 101, 71, 19, 15, 1, 2, 1, 76, 257, 337, 297, 151, 97, 22, 17, 1, 2, 1, 123, 511, 799, 701, 506, 211, 127, 25, 19, 1, 2
Offset: 0

Views

Author

Henry Bottomley, Sep 02 2002

Keywords

Examples

			Array starts as:
  2, 1,  1,  1,  1,   1, ...;
  2, 1,  3,  4,  7,  11, ...;
  2, 1,  5,  7, 17,  31, ...;
  2, 1,  7, 10, 31,  61, ...;
  2, 1,  9, 13, 49, 101, ...;
  2, 1, 11, 16, 71, 151, ...; etc.
		

Crossrefs

Cf. A060959.
Columns include: A007395, A000012, A005408, A016777, A056220, A062786.

Programs

  • Magma
    [2^(1+k-n)*(&+[Binomial(n-k,2*j)*(1+4*k)^j: j in [0..Floor((n-k)/2)]]): k in [0..n], n in [0..13]]; // G. C. Greubel, Jan 27 2020
    
  • Maple
    seq(seq( 2^(1+k-n)*add( binomial(n-k, 2*j)*(1+4*k)^j, j=0..floor((n-k)/2)), k=0..n), n=0..13); # G. C. Greubel, Jan 27 2020
  • Mathematica
    T[n_, k_]:= ((1 + Sqrt[1+4n])/2)^k + ((1 - Sqrt[1+4n])/2)^k; Table[If[n==0 && k==0, 2, T[k, n-k]]//Simplify, {n,0,13}, {k,0,n}]//Flatten (* G. C. Greubel, Jan 27 2020 *)
  • Sage
    def T(n, k): return 2^(1-k)*sum( binomial(k, 2*j)*(1+4*n)^j for j in (0..floor(k/2)) )
    [[T(k,n-k) for k in (0..n)] for n in (0..13)] # G. C. Greubel, Jan 27 2020

Formula

T(n, k) = ((1+sqrt(4*n+1))/2)^k + ((1-sqrt(4*n+1))/2)^k = 2*A060959(n, k+1) - A060959(n, k).
T(n, k) = 2^(1-k)*Sum_{j=0..floor(k/2)} binomial(k, 2*j)*(1+4*n)^j. - G. C. Greubel, Jan 27 2020

A101622 A Horadam-Jacobsthal sequence.

Original entry on oeis.org

0, 1, 6, 13, 30, 61, 126, 253, 510, 1021, 2046, 4093, 8190, 16381, 32766, 65533, 131070, 262141, 524286, 1048573, 2097150, 4194301, 8388606, 16777213, 33554430, 67108861, 134217726, 268435453, 536870910, 1073741821, 2147483646, 4294967293, 8589934590
Offset: 0

Views

Author

Paul Barry, Dec 10 2004

Keywords

Comments

Companion sequence to A084639.
This is the sequence A(0,1;1,2;5) of the family of sequences [a,b:c,d:k] considered by G. Detlefs, and treated as A(a,b;c,d;k) in the W. Lang link given below. - Wolfdieter Lang, Oct 18 2010
Except for the initial three terms, the decimal representation of the x-axis, from the left edge to the origin, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 961", based on the 5-celled von Neumann neighborhood, initialized with a single black (ON) cell at stage zero. - Robert Price, Mar 27 2017
Named after the Australian mathematician Alwyn Francis Horadam (1923-2016) and the German mathematician Ernst Jacobsthal (1882-1965). - Amiram Eldar, Jun 10 2021

References

  • Stephen Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.

Crossrefs

Cf. A131953.

Programs

  • Magma
    [(2^(n+2)+(-1)^n-5)/2: n in [0..35]]; // Vincenzo Librandi, Aug 12 2011
    
  • Mathematica
    LinearRecurrence[{2,1,-2},{0,1,6},40] (* Harvey P. Dale, Jul 08 2014 *)
  • PARI
    concat(0, Vec(x*(1+4*x)/((1-x)*(1+x)*(1-2*x)) + O(x^30))) \\ Colin Barker, Mar 28 2017

Formula

a(n) = (2^(n+2) + (-1)^n - 5)/2.
G.f.: x*(1+4*x)/((1-x)*(1+x)*(1-2*x)).
a(n) = (A014551(n+2)-5)/2.
(1, 6, 13, 30, 61, ...) are the row sums of A131953. - Gary W. Adamson, Jul 31 2007
From Paul Curtz, Jan 01 2009: (Start)
a(n) = a(n-1) + 2*a(n-2) + 5.
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3).
a(n) = A000079(n+1) - A010693(n).
a(n+1) = A141722(n) + 5 = A141722(n) + A010716(n).
a(2n+1) - a(2n) = 1, 7, 31, ... = A083420.
a(2n+1) - 2*a(2n) = 1.
a(2n) = A002446 = 6*A002450, a(2n+1) = A141725. (End)
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3) for n>2. - Colin Barker, Mar 28 2017
a(n) = (1/2) * Sum_{k=1..n} binomial(n+1,k) * (2+(-1)^k). - Wesley Ivan Hurt, Sep 23 2017

A048700 Binary palindromes of odd length (written in base 10).

Original entry on oeis.org

1, 5, 7, 17, 21, 27, 31, 65, 73, 85, 93, 99, 107, 119, 127, 257, 273, 297, 313, 325, 341, 365, 381, 387, 403, 427, 443, 455, 471, 495, 511, 1025, 1057, 1105, 1137, 1161, 1193, 1241, 1273, 1285, 1317, 1365, 1397, 1421, 1453, 1501, 1533, 1539, 1571, 1619, 1651
Offset: 1

Views

Author

Antti Karttunen, Mar 07 1999

Keywords

Comments

Note: you get A006995 (all binary palindromes) if you take (after zero) alternatively 2^n (starting from 2^0 = 1) terms from A048700 and as many from A048701 and then each time, twice as many from both.
A178225(a(n)) = 1. - Reinhard Zumkeller, Oct 21 2011
Comment from Altug Alkan, Dec 03 2015: (Start)
a(6*k) is divisible by 9 for k > 0.
a(3*k+(-1)^k-2) is divisible by 3 for k > 1.
The minimum value of a(n+1) - a(n) occurs when n = 2.
A014551(n) appears in this sequence for n > 0. (End)

Crossrefs

Cf. A048701 (binary palindromes of even length), A002113 (decimal palindromes), A006995 (all binary palindromes).
Cf. also A178225.

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    import Data.List (unfoldr)
    a048700 n = a048700_list !! (n-1)
    a048700_list = f 1 $ singleton 1 where
       f z s = m : f (z+1) (insert (c 0) (insert (c 1) s')) where
         c d = foldl (\v d -> 2 * v + d) 0 $ (reverse b) ++ [d] ++ b
         b = unfoldr
             (\x -> if x == 0 then Nothing else Just $ swap $ divMod x 2) z
         (m,s') = deleteFindMin s
    -- Reinhard Zumkeller, Oct 21 2011
    
  • Maple
    bit_i := (x,i) -> `mod`(floor(x/(2^i)),2);
    floor_log_2 := proc(n) local nn,i: nn := n; for i from -1 to n do if(0 = nn) then RETURN(i); fi: nn := floor(nn/2); od: end:
  • Mathematica
    Select[Range@ 1651, # == Reverse@ # && OddQ@ Length@ # &@ IntegerDigits[#, 2] &] (* Michael De Vlieger, Dec 03 2015 *)
  • PARI
    {a(n) = local(f); if( n<1, 0, f = length(binary(n)) - 1; 2^f*n + sum(i=1, f, bittest(n,i) * 2^(f-i)))}; /* Michael Somos, Nov 27 2002 */
    
  • Python
    def A048700(n):
        s = bin(n)[2:]
        return int(s+s[-2::-1],2) # Chai Wah Wu, Feb 26 2021

Formula

a(n) = (2^(floor_log_2(n)))*n + sum('(bit_i(n, i)*(2^(floor_log_2(n)-i)))', 'i'=1..floor_log_2(n));
a(A047264(n)) mod 3 = 0, for n > 1. - Altug Alkan, Dec 03 2015

A087451 G.f.: (2-x)/((1+2x)(1-3x)); e.g.f.: exp(3x)+exp(-2x); a(n)=3^n+(-2)^n.

Original entry on oeis.org

2, 1, 13, 19, 97, 211, 793, 2059, 6817, 19171, 60073, 175099, 535537, 1586131, 4799353, 14316139, 43112257, 129009091, 387682633, 1161737179, 3487832977, 10458256051, 31385253913, 94134790219, 282446313697, 847255055011
Offset: 0

Views

Author

Paul Barry, Sep 06 2003

Keywords

Comments

Generalized Lucas-Jacobsthal numbers.
Pisano period lengths: 1, 1, 1, 2, 4, 1, 6, 2, 3, 4, 5, 2, 12, 6, 4, 4, 16, 3, 18, 4,... - R. J. Mathar, Aug 10 2012

Crossrefs

Programs

  • Maple
    for i from 0 to 20 do print(3^i+(-2)^i) od; # Gary Detlefs, Dec 20 2009
  • Mathematica
    a[0] = 2; a[1] = 1; a[n_] := a[n] = a[n - 1] + 6a[n - 2]; a /@ Range[0, 25] (* Robert G. Wilson v, Feb 02 2006 *)
  • Sage
    [lucas_number2(n,1,-6) for n in range(0, 26)] # Zerinvary Lajos, Apr 30 2009

Formula

a(0) = 2, a(1) = 1, a(n) = a(n-1)+6a(n-2).
a(n) = 3^n + (-2)^n. - Gary Detlefs, Dec 20 2009
The sequence 1, 13, 19... is a(n+1) = 3*3^n-2*(-2)^n.
exp( Sum_{n >= 1} a(n)*x^n/n ) = Sum_{n >= 0} A015441(n+1)*x^n. - Peter Bala, Mar 30 2015
a(n) = 2*A015441(n+1) - A015441(n), a formula given by Paul Curtz for autosequences of the 2nd kind. - Jean-François Alcover, Jun 02 2017

A135440 a(n) = a(n-1) + 2a(n-2).

Original entry on oeis.org

-1, 4, 2, 10, 14, 34, 62, 130, 254, 514, 1022, 2050, 4094, 8194, 16382, 32770, 65534, 131074, 262142, 524290, 1048574, 2097154, 4194302, 8388610, 16777214, 33554434, 67108862, 134217730, 268435454, 536870914, 1073741822, 2147483650, 4294967294, 8589934594, 17179869182, 34359738370
Offset: 0

Views

Author

Paul Curtz, Feb 18 2008

Keywords

Comments

First differences of A014551. - Reinhard Zumkeller, Jan 02 2013
It can be noticed that, once deprived of its first term, this is an "autosequence" of the second kind, whose companion of the first kind is A014113. - Jean-François Alcover, Aug 19 2022

Programs

  • Haskell
    a135440 n = a135440_list !! n
    a135440_list = zipWith (-) (tail a014551_list) a014551_list
    -- Reinhard Zumkeller, Jan 02 2013
  • Mathematica
    f[n_]:=2/(n+1);x=4;Table[x=f[x];Numerator[x],{n,0,5!}] (* Vladimir Joseph Stephan Orlovsky, Mar 12 2010 *)
    LinearRecurrence[{1,2}, {-1,4}, 25] (* or *) Table[2^n - 2*(-1)^n, {n,0,25}] (* G. C. Greubel, Oct 14 2016 *)

Formula

From R. J. Mathar, Feb 19 2008: (Start)
O.g.f.: -1/(2*x-1) - 2/(1+x).
a(n) = 2^n - 2*(-1)^n. (End)
a(n) = 2*A014551(n-1), n>0. - Paul Curtz, Jun 01 2011
E.g.f.: exp(2*x) - 2*exp(-x). - G. C. Greubel, Oct 14 2016

Extensions

More terms from R. J. Mathar, Feb 19 2008

A140253 a(2*n) = 2*(2*4^(n-1)-1) and a(2*n-1) = 2*4^(n-1)-1.

Original entry on oeis.org

-1, 1, 2, 7, 14, 31, 62, 127, 254, 511, 1022, 2047, 4094, 8191, 16382, 32767, 65534, 131071, 262142, 524287, 1048574, 2097151, 4194302, 8388607, 16777214, 33554431, 67108862, 134217727, 268435454, 536870911
Offset: 0

Views

Author

Paul Curtz, Jun 23 2008

Keywords

Comments

The inverse binomial transform is 1, 1, 4, -2, 10, -14, 34, -62 which leads to (-1)^(n+1)*A135440(n).
For n > 0: A266161(a(n)) = n and A266161(m) < n for m < a(n). - Reinhard Zumkeller, Dec 22 2015
Also, the decimal representation of the diagonal from the corner to the origin of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 673", based on the 5-celled von Neumann neighborhood, initialized with a single black (ON) cell at stage zero. - Robert Price, Jul 23 2017

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a140253 n = a140253_list !! n
    a140253_list = -1 : concat
                        (transpose [a083420_list, map (* 2) a083420_list])
    -- Reinhard Zumkeller, Dec 22 2015
  • Maple
    A140253:=proc(n): if type(n, odd) then 2*4^(((n+1)/2)-1)-1 else 2*(2*4^((n/2)-1)-1) fi: end: seq(A140253(n),n=0..29); # Johannes W. Meijer, Jun 24 2011
  • Mathematica
    Table[(2^(n+1) - 3 + (-1)^(n+1))/2, {n, 0, 30}] (* Jean-François Alcover, Jun 05 2017 *)

Formula

a(2*n) = 2*A083420(n-1) and a(2*n+1) = A083420(n)
a(n+1) - a(n) = A014551(n); Jacobsthal-Lucas numbers.
a(2*n) + a(2*n+1) = 9*A002450(n)
a(n+1) - 2*a(n) = A010674(n+1); repeat 3, 0.
a(n) + A000034(n+1) = A000079(n); powers of 2.
a(n)= a(n-1) + 2*a(n-2) + 3. - Gary Detlefs, Jun 22 2010
a(n+1) = A000069(2^n); odious numbers. - Johannes W. Meijer, Jun 24 2011
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3) for n>2, a(0) = -1, a(1) = 1, a(2) = 2. - Philippe Deléham, Feb 25 2012
G.f.: (x^2+3*x-1)/((1-2*x)*(1-x)*(1+x)). - Philippe Deléham, Feb 25 2012

Extensions

Edited, corrected and information added by Johannes W. Meijer, Jun 24 2011

A166956 a(n) = 2^n +(-1)^n - 2.

Original entry on oeis.org

0, -1, 3, 5, 15, 29, 63, 125, 255, 509, 1023, 2045, 4095, 8189, 16383, 32765, 65535, 131069, 262143, 524285, 1048575, 2097149, 4194303, 8388605, 16777215, 33554429, 67108863, 134217725, 268435455, 536870909, 1073741823, 2147483645, 4294967295, 8589934589
Offset: 0

Views

Author

Paul Curtz, Oct 25 2009

Keywords

Comments

The inverse binomial transform yields 0,-1,5,-7,17,-31,..., a sign alternating variant of A014551.
In a table of a(n) and higher-order differences in successive rows, the main diagonal contains 0, 4, 8, 16, ... (zero followed by A020707).
Similar to the decimal representation of the diagonal from the corner to the origin of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 899", based on the 5-celled von Neumann neighborhood, initialized with a single black (ON) cell at stage zero, which begins with 1,3,5,15,29,63,125. - Robert Price, Aug 08 2017

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.

Crossrefs

Programs

  • Magma
    [2^n-2+(-1)^n: n in [0..40]]; // Vincenzo Librandi, Apr 28 2011
  • Mathematica
    LinearRecurrence[{2,1,-2},{0,-1,3},20] (* G. C. Greubel, May 29 2016 *)

Formula

a(n) = A000079(n) - A010684(n).
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3).
G.f.: x*(5*x -1)/((1-x)*(1-2*x)*(1+x)).
E.g.f.: exp(2*x) - 2*exp(x) + exp(-x). - G. C. Greubel, May 29 2016

Extensions

Edited and extended by R. J. Mathar, Mar 02 2010

A075118 Variant on Lucas numbers: a(n) = a(n-1) + 3*a(n-2) with a(0)=2 and a(1)=1.

Original entry on oeis.org

2, 1, 7, 10, 31, 61, 154, 337, 799, 1810, 4207, 9637, 22258, 51169, 117943, 271450, 625279, 1439629, 3315466, 7634353, 17580751, 40483810, 93226063, 214677493, 494355682, 1138388161, 2621455207, 6036619690, 13900985311, 32010844381, 73713800314, 169746333457
Offset: 0

Views

Author

Henry Bottomley, Sep 02 2002

Keywords

Comments

The sequence 4,1,7,.. = 2*0^n+A075118(n) is given by trace(A^n) where A=[1,1,1,1;1,0,0,0;1,0,0,0;1,0,0,0]. - Paul Barry, Oct 01 2004
For n>2, a(n) is the numerator of the value of the continued fraction 1+3/(1+3/(1+...+3/7)) where there are n-2 1's. - Alexander Mark, Aug 16 2020

Examples

			a(4) = a(3)+3*a(2) = 10+3*7 = 31.
		

References

  • Thomas Koshy, "Fibonacci and Lucas Numbers with Applications", Wiley, 2001, p. 471.

Crossrefs

Programs

  • GAP
    a:=[2,1];; for n in [3..40] do a[n]:=a[n-1]+3*a[n-2]; od; a; # G. C. Greubel, Jan 15 2020
  • Magma
    I:=[2,1]; [n le 2 select I[n] else Self(n-1)+3*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Jul 20 2013
    
  • Magma
    R:=PowerSeriesRing(Integers(), 33); Coefficients(R!((2-x)/(1-x-3*x^2))); // Marius A. Burtea, Jan 15 2020
    
  • Maple
    a:= n-> (Matrix([[1,2]]). Matrix([[1,1], [3,0]])^n)[1,2]:
    seq(a(n), n=0..35);  # Alois P. Heinz, Aug 15 2008
  • Mathematica
    a[0]=2; a[1]=1; a[n_]:= a[n]= a[n-1] +3a[n-2]; Table[a[n], {n, 0, 30}]
    CoefficientList[Series[(2-x)/(1-x-3x^2), {x,0,40}], x] (* Vincenzo Librandi, Jul 20 2013 *)
    LinearRecurrence[{1,3},{2,1},40] (* Harvey P. Dale, Jun 18 2017 *)
    Table[Round[Sqrt[3]^n*LucasL[n, 1/Sqrt[3]]], {n,0,40}] (* G. C. Greubel, Jan 15 2020 *)
  • PARI
    my(x='x+O('x^30)); Vec((2-x)/(1-x-3*x^2)) \\ G. C. Greubel, Dec 21 2017
    
  • PARI
    polsym(x^2-x-3, 44) \\ Joerg Arndt, Jan 22 2023
    
  • Sage
    [lucas_number2(n,1,-3) for n in range(0, 30)] # Zerinvary Lajos, Apr 30 2009
    

Formula

a(n) = ((1+sqrt(13))/2)^n + ((1-sqrt(13))/2)^n.
a(n) = 2*A006130(n) - A006130(n-1) = A075117(3, n).
G.f.: (2-x)/(1-x-3*x^2). - Philippe Deléham, Nov 15 2008
a(n) = [x^n] ( (1 + x + sqrt(1 + 2*x + 13*x^2))/2 )^n for n >= 1. - Peter Bala, Jun 23 2015
a(n) = 3^(n/2) * Lucas(n, 1/sqrt(3)). - G. C. Greubel, Jan 15 2020
Previous Showing 11-20 of 60 results. Next