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.

Showing 1-9 of 9 results.

A007482 a(n) is the number of subsequences of [ 1, ..., 2n ] in which each odd number has an even neighbor.

Original entry on oeis.org

1, 3, 11, 39, 139, 495, 1763, 6279, 22363, 79647, 283667, 1010295, 3598219, 12815247, 45642179, 162557031, 578955451, 2061980415, 7343852147, 26155517271, 93154256107, 331773802863, 1181629920803, 4208437368135
Offset: 0

Views

Author

Keywords

Comments

The even neighbor must differ from the odd number by exactly one.
If we defined this sequence by the recurrence (a(n) = 3*a(n-1) + 2*a(n-2)) that it satisfies, we could prefix it with an initial 0.
a(n) equals term (1,2) in M^n, M = the 3 X 3 matrix [1,1,2; 1,0,1; 2,1,1]. - Gary W. Adamson, Mar 12 2009
a(n) equals term (2,2) in M^n, M = the 3 X 3 matrix [0,1,0; 1,3,1; 0,1,0]. - Paul Barry, Sep 18 2009
From Gary W. Adamson, Aug 06 2010: (Start)
Starting with "1" = INVERT transform of A002605: (1, 2, 6, 16, 44, ...).
Example: a(3) = 39 = (16, 6, 2, 1) dot (1, 1, 3, 11) = (16 + 6 + 6 + 11). (End)
Pisano periods: 1, 1, 4, 1, 24, 4, 48, 2, 12, 24, 30, 4, 12, 48, 24, 4,272, 12, 18, 24, ... . - R. J. Mathar, Aug 10 2012
A007482 is also the number of ways of tiling a 3 X n rectangle with 1 X 1 squares, 2 X 2 squares and 2 X 1 (vertical) dominoes. - R. K. Guy, May 20 2015
With offset 1 (a(0) = 0, a(1) = 1) this is a divisibility sequence. - Michael Somos, Jun 03 2015
Number of elements of size 2^(-n) in a fractal generated by the second-order reversible cellular automaton, rule 150R (see the reference and the link). - Yuriy Sibirmovsky, Oct 04 2016
a(n) is the number of compositions (ordered partitions) of n into parts 1 (of three kinds) and 2 (of two kinds). - Joerg Arndt, Oct 05 2016
a(n) equals the number of words of length n over {0,1,2,3,4} in which 0 and 1 avoid runs of odd lengths. - Milan Janjic, Jan 08 2017
Start with a single cell at coordinates (0, 0), then iteratively subdivide the grid into 2 X 2 cells and remove the cells that have two '1's in their modulo 3 coordinates. a(n) is the number of cells after n iterations. Cell configuration converges to a fractal with approximate dimension 1.833. - Peter Karpov, Apr 20 2017
This is the Lucas sequence U(P=3,Q=-2), and hence for n>=0, a(n+2)/a(n+1) equals the continued fraction 3 + 2/(3 + 2/(3 + 2/(3 + ... + 2/3))) with n 2's. - Greg Dresden, Oct 06 2019

Examples

			G.f. = 1 + 3*x + 11*x^2 + 39*x^3 + 139*x^4 + 495*x^5 + 1763*x^6 + ...
From _M. F. Hasler_, Jun 16 2019: (Start)
For n = 0, (1, ..., 2n) = () is the empty sequence, which is equal to its only subsequence, which satisfies the condition voidly, whence a(0) = 1.
For n = 1, (1, ..., 2n) = (1, 2); among the four subsequences {(), (1), (2), (1,2)} only (1) does not satisfy the condition, whence a(1) = 3.
For n = 2, (1, ..., 2n) = (1, 2, 3, 4); among the sixteen subsequences {(), ..., (1,2,3,4)}, the 5 subsequences (1), (3), (1,3), (2,3,4) and (1,2,3,4) do not satisfy the condition, whence a(2) = 16 - 5 = 11.
(End)
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Stephen Wolfram, A New Kind of Science, Wolfram Media, 2002, p. 439.

Crossrefs

Row sums of triangle A073387.
Cf. A000045, A000129, A001045, A007455, A007481, A007483, A007484, A015518, A201000 (prime subsequence), A052913 (binomial transform), A026597 (inverse binomial transform).
Cf. A206776.

Programs

  • Haskell
    a007482 n = a007482_list !! (n-1)
    a007482_list = 1 : 3 : zipWith (+)
                   (map (* 3) $ tail a007482_list) (map (* 2) a007482_list)
    -- Reinhard Zumkeller, Oct 21 2015
    
  • Magma
    I:=[1,3]; [n le 2 select I[n] else 3*Self(n-1) + 2*Self(n-2): n in [1..30]]; // G. C. Greubel, Jan 16 2018
  • Maple
    a := n -> `if`(n=0, 1, 3^n*hypergeom([(1-n)/2,-n/2], [-n], -8/9)):
    seq(simplify(a(n)), n = 0..23); # Peter Luschny, Jun 28 2017
  • Mathematica
    a[n_]:=(MatrixPower[{{1,4},{1,2}},n].{{1},{1}})[[2,1]]; Table[a[n],{n,0,40}] (* Vladimir Joseph Stephan Orlovsky, Feb 19 2010 *)
    LinearRecurrence[{3,2},{1,3},30] (* Harvey P. Dale, May 25 2013 *)
    a[ n_] := Module[ {m = n + 1, s = 1}, If[ m < 0, {m, s} = -{m, (-2)^m}]; s SeriesCoefficient[ x / (1 - 3 x - 2 x^2), {x, 0, m}]]; (* Michael Somos, Jun 03 2015 *)
    a[ n_] := With[{m = n + 1}, If[ m < 0, (-2)^m a[ -m], Expand[((3 + Sqrt[17])/2)^m - ((3 - Sqrt[17])/2)^m ] / Sqrt[17]]]; (* Michael Somos, Oct 13 2016 *)
  • Maxima
    a(n) := if n=0 then 1 elseif n=1 then 3 else 3*a(n-1)+2*a(n-2);
    makelist(a(n),n,0,12); /* Emanuele Munarini, Jun 28 2017 */
    
  • PARI
    {a(n) = 2*imag(( (3 + quadgen(68)) / 2)^(n+1))}; /* Michael Somos, Jun 03 2015 */
    
  • Sage
    [lucas_number1(n,3,-2) for n in range(1, 25)] # Zerinvary Lajos, Apr 22 2009
    

Formula

G.f.: 1/(1-3*x-2*x^2).
a(n) = 3*a(n-1) + 2*a(n-2).
a(n) = (ap^(n+1)-am^(n+1))/(ap-am), where ap = (3+sqrt(17))/2 and am = (3-sqrt(17))/2.
Let b(0) = 1, b(k) = floor(b(k-1)) + 2/b(k-1); then, for n>0, b(n) = a(n)/a(n-1). - Benoit Cloitre, Sep 09 2002
The Hankel transform of this sequence is [1,2,0,0,0,0,0,0,0,...]. - Philippe Deléham, Nov 21 2007
a(n) = Sum_{k=0..floor(n/2)} binomial(n-k, k)2^k*3^(n-2k). - Paul Barry, Apr 23 2005
a(n) = Sum_{k=0..n} A112906(n,k). - Philippe Deléham, Nov 21 2007
a(n) = - a(-2-n) * (-2)^(n+1) for all n in Z. - Michael Somos, Jun 03 2015
If c = (3 + sqrt(17))/2, then c^n = (A206776(n) + sqrt(17)*a(n-1)) / 2. - Michael Somos, Oct 13 2016
a(n) = 3^n*hypergeom([(1-n)/2,-n/2], [-n], -8/9) for n>=1. - Peter Luschny, Jun 28 2017
a(n) = round(((sqrt(17) + 3)/2)^(n+1)/sqrt(17)). The distance of the argument from the nearest integer is about 1/2^(n+3). - M. F. Hasler, Jun 16 2019
E.g.f.: (1/17)*exp(3*x/2)*(17*cosh(sqrt(17)*x/2) + 3*sqrt(17)*sinh(sqrt(17)*x/2)). - Stefano Spezia, Oct 07 2019
a(n) = (sqrt(2)*i)^n * ChebyshevU(n, -3*i/(2*sqrt(2))). - G. C. Greubel, Dec 24 2021
G.f.: 1/(1 - 3*x - 2*x^2) = Sum_{n >= 0} x^n * Product_{k = 1..n} (k + 2*x + 2)/(1 + k*x) (a telescoping series). Cf. A015518. - Peter Bala, May 08 2024

A286188 Number of connected induced (non-null) subgraphs of the gear graph with 2n+1 nodes.

Original entry on oeis.org

6, 26, 76, 218, 664, 2174, 7452, 26130, 92512, 328774, 1170052, 4166106, 14836488, 52839374, 188188396, 670240802, 2387095600, 8501764310, 30279479508, 107841961962, 384084839128, 1367938434910, 4871984975932, 17351831789874, 61799465313024
Offset: 1

Views

Author

Giovanni Resta, May 04 2017

Keywords

Crossrefs

Cf. A020873 (wheel), A059020 (ladder), A059525 (grid), A286139 (king), A286182 (prism), A286183 (antiprism), A286184 (helm), A286185 (Möbius ladder), A286186 (friendship), A286187 (web), A286188 (gear), A286189 (rook), A285765 (queen).

Programs

  • Mathematica
    a[n_] := Block[{g = Graph@ Flatten[{Table[i <-> 2 n + 1, {i, 2, 2 n, 2}], Table[i <-> Mod[i, 2 n] + 1, {i, 2 n}]}]}, -1 + ParallelSum[ Boole@ ConnectedGraphQ@ Subgraph[g, s], {s, Subsets@ Range[2 n + 1]}]]; Array[a, 8]

Formula

a(n) = 6*a(n-1) - 10*a(n-2) + 4*a(n-3) + 3*a(n-4) - 2*a(n-5), for n>5.
a(n) = A206776(n) + 4*n^2 - 2*n + 1. - Eric W. Weisstein, May 08 2017
G.f.: 2*x*(3 - 5*x - 10*x^2 - x^3 - 3*x^4) / ((1 - x)^3*(1 - 3*x - 2*x^2)). - Colin Barker, May 31 2017

Extensions

a(16)-a(25) from Andrew Howroyd, May 20 2017

A124805 Number of circular n-letter words over the alphabet {0,1,2,3} with adjacent letters differing by at most 2.

Original entry on oeis.org

1, 4, 14, 46, 162, 574, 2042, 7270, 25890, 92206, 328394, 1169590, 4165554, 14835838, 52838618, 188187526, 670239810, 2387094478, 8501763050, 30279478102, 107841960402, 384084837406, 1367938433018, 4871984973862
Offset: 0

Views

Author

R. H. Hardin, Dec 28 2006

Keywords

Comments

Empirical: a(base, n) = a(base-1, n) + A005191(n+1) for base >= 2*floor(n/2) + 1 where base is the number of letters in the alphabet.
Sequence appears to have generating function (1-x^2-4*x^3)/((1-x)*(1-3*x-2*x^2)). The degree of the numerator would drop by one if the initial term were changed from 1 to 3: (3-8*x+x^2)/((1-x)*(1-3*x-2*x^2)). - Creighton Dement, Aug 20 2007

Crossrefs

Programs

  • Magma
    I:=[1,4,14,46]; [n le 4 select I[n] else 4*Self(n-1) -Self(n-2) -2*Self(n-3): n in [1..40]]; // G. C. Greubel, Aug 03 2023
    
  • Mathematica
    LinearRecurrence[{4,-1,-2}, {1,4,14,46}, 40] (* G. C. Greubel, Aug 03 2023 *)
  • SageMath
    A206776=BinaryRecurrenceSequence(3,2,2,3)
    [1+A206776(n) -2*int(n==0) for n in range(41)] # G. C. Greubel, Aug 03 2023

Formula

a(n) = 1 + A206776(n) for n > 0. - Bruno Berselli, Jan 11 2013
From Colin Barker, Jun 02 2017: (Start)
G.f.: (1 - x^2 - 4*x^3) / ((1 - x)*(1 - 3*x - 2*x^2)).
a(n) = 1 + ((3-sqrt(17))/2)^n + ((3+sqrt(17))/2)^n for n>0.
a(n) = 4*a(n-1) - a(n-2) - 2*a(n-3) for n > 3. (End)

A297047 Number of edge covers in the n-wheel graph.

Original entry on oeis.org

0, 2, 10, 41, 154, 562, 2023, 7240, 25842, 92129, 328270, 1169390, 4165231, 14835316, 52837774, 188186161, 670237602, 2387090906, 8501757271, 30279468752, 107841945274, 384084812929, 1367938393414, 4871984909782, 17351831683935, 61799465142812, 220102059235510
Offset: 1

Views

Author

Eric W. Weisstein, Dec 24 2017

Keywords

Comments

Extended to a(1)-a(3) using the formula/recurrence.

Programs

  • Maple
    f:= gfun:-rectoproc({a(n) = 4*a(n-1) - 5*a(n-3) - 2*a(n-4),a(1)=0,a(2)=2,a(3)=10,a(4)=41},a(n),remember):
    map(f, [$1..30]); # Robert Israel, Dec 26 2017
  • Mathematica
    Table[I^(n - 1) 2^((n + 1)/2) ChebyshevT[n - 1, -3 I/(2 Sqrt[2])] - LucasL[n - 1, 1], {n, 20}]
    LinearRecurrence[{4, 0, -5, -2}, {0, 2, 10, 41}, 20]
    CoefficientList[Series[x (2 + 2 x + x^2)/(1 - 4 x + 5 x^3 + 2 x^4), {x, 0, 20}], x]
  • PARI
    first(n) = Vec(x^2*(2 + 2*x + x^2)/(1 - 4*x + 5*x^3 + 2*x^4) + O(x^(n+1)), -n) \\ Iain Fox, Dec 24 2017

Formula

a(n) = A206776(n-1) - A000032(n-1).
a(n) = 4*a(n-1) - 5*a(n-3) - 2*a(n-4).
G.f.: x^2*(2+2*x+x^2) / ( (x^2+x-1)*(2*x^2+3*x-1) ).
a(n) = 2^(-2-n)*(2*(1-sqrt(5))^n*(1+sqrt(5)) - 2*(-1+sqrt(5))*(1+sqrt(5))^n - 3*(3-sqrt(17))^n-sqrt(17)*(3-sqrt(17))^n - 3*(3+sqrt(17))^n+sqrt(17)*(3+sqrt(17))^n). - Colin Barker, Dec 28 2017

A364741 Number of edge covers in the n-double cone graph.

Original entry on oeis.org

0, 8, 160, 2009, 25872, 328208, 4165357, 52837520, 670238112, 8501756249, 107841947320, 1367938389320, 17351831692125, 220102059219128, 2791919445762040, 35414544563765129, 449221401563485632, 5698220042111151488, 72279974941308391117, 916846794068851162400, 11629888423130623254672
Offset: 0

Views

Author

Eric W. Weisstein, Aug 05 2023

Keywords

Comments

The n-double cone graph is defined for n >= 3. The sequence has been extended to a(0)-a(2) using the formula/recurrence. - Andrew Howroyd, Aug 08 2023

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{13, 2, -75, -17, 38, -8}, {0, 8, 160, 2009, 25872, 328208}, 25] (* Paolo Xausa, Nov 18 2023 *)
    CoefficientList[Series[-x (-8 - 56 x + 87 x^2 - 35 x^3 + 10 x^4)/((1 + x) (1 + 2 x) (1 - 3 x + x^2) (1 - 13 x + 4 x^2)), {x, 0, 20}], x] (* Eric W. Weisstein, May 25 2024 *)
    Table[2 (-1)^n (2^n - 1) - LucasL[2 n] + ((13 - 3 Sqrt[17])^n + (13 + 3 Sqrt[17])^n)/2^n, {n, 20}] // Expand (* Eric W. Weisstein, May 25 2024 *)
  • PARI
    concat(0, Vec((8 + 56*x - 87*x^2 + 35*x^3 - 10*x^4)/((1 + x)*(1 + 2*x)*(1 - 3*x + x^2)*(1 - 13*x + 4*x^2)) + O(x^20))) \\ Andrew Howroyd, Aug 08 2023

Formula

From Andrew Howroyd, Aug 08 2023: (Start)
a(n) = A206776(n)^2 - A000032(n)^2.
a(n) = 13*a(n-1) + 2*a(n-2) - 75*a(n-3) - 17*a(n-4) + 38*a(n-5) - 8*a(n-6) for n >= 6.
G.f.: x*(8 + 56*x - 87*x^2 + 35*x^3 - 10*x^4)/((1 + x)*(1 + 2*x)*(1 - 3*x + x^2)*(1 - 13*x + 4*x^2)). (End)

Extensions

a(0)-a(2) and terms a(8) and beyond from Andrew Howroyd, Aug 08 2023

A287426 Number of connected induced subgraphs in the n-sun graph.

Original entry on oeis.org

3, 14, 47, 164, 577, 2046, 7275, 25896, 92213, 328402, 1169599, 4165564, 14835849, 52838630, 188187539, 670239824, 2387094493, 8501763066, 30279478119, 107841960420, 384084837425, 1367938433038, 4871984973883, 17351831787640, 61799465310597, 220102059506978
Offset: 1

Views

Author

Eric W. Weisstein, May 24 2017

Keywords

Crossrefs

Cf. A206776.

Programs

  • Mathematica
    LinearRecurrence[{5, -5, -1, 2}, {3, 14, 47, 164}, 20]
  • PARI
    Vec(x*(3 - x - 8*x^2 + 2*x^3) / ((1 - x)^2*(1 - 3*x - 2*x^2)) + O(x^40)) \\ Colin Barker, May 25 2017

Formula

a(n) = A206776(n) + n - 1.
From Colin Barker, May 25 2017: (Start)
G.f.: x*(3 - x - 8*x^2 + 2*x^3)/((1 - x)^2*(1 - 3*x - 2*x^2)).
a(n) = -1 + n + ((3-sqrt(17))/2)^n + ((3+sqrt(17))/2)^n.
a(n) = 5*a(n-1) - 5*a(n-2) - a(n-3) + 2*a(n-4) for n>4. (End)

A309852 Array read by antidiagonals: ((z+sqrt(x))/2)^k + ((z-sqrt(x))/2)^k for columns k >= 0 and rows n >= 0, where x = 4*n+1 and y = floor(sqrt(x)) and z = y-1+(y mod 2).

Original entry on oeis.org

2, 1, 2, 1, 1, 2, 1, 3, 3, 2, 1, 4, 9, 3, 2, 1, 7, 27, 11, 3, 2, 1, 11, 81, 36, 13, 3, 2, 1, 18, 243, 119, 45, 15, 5, 2, 1, 29, 729, 393, 161, 54, 25, 5, 2, 1, 47, 2187, 1298, 573, 207, 125, 27, 5, 2, 1, 76, 6561, 4287, 2041, 783, 625, 140, 29, 5, 2
Offset: 0

Views

Author

Charles L. Hohn, Aug 20 2019

Keywords

Comments

One of 4 related arrays (the others being A191347, A191348, and A309853) where the two halves of the main formula approach the integers shown and 0 respectively, and also with A309853 where rows represent various Fibonacci series a(n) = a(n-2)*b + a(n-1)*c where b and c are integers >= 0.

Examples

			Array begins:
  2, 1,  1,   1,    1,    1,     1,      1,       1,       1,        1, ...
  2, 1,  3,   4,    7,   11,    18,     29,      47,      76,      123, ...
  2, 3,  9,  27,   81,  243,   729,   2187,    6561,   19683,    59049, ...
  2, 3, 11,  36,  119,  393,  1298,   4287,   14159,   46764,   154451, ...
  2, 3, 13,  45,  161,  573,  2041,   7269,   25889,   92205,   328393, ...
  2, 3, 15,  54,  207,  783,  2970,  11259,   42687,  161838,   613575, ...
  2, 5, 25, 125,  625, 3125, 15625,  78125,  390625, 1953125,  9765625, ...
  2, 5, 27, 140,  727, 3775, 19602, 101785,  528527, 2744420, 14250627, ...
  2, 5, 29, 155,  833, 4475, 24041, 129155,  693857, 3727595, 20025689, ...
  2, 5, 31, 170,  943, 5225, 28954, 160445,  889087, 4926770, 27301111, ...
  2, 5, 33, 185, 1057, 6025, 34353, 195865, 1116737, 6367145, 36302673, ...
  ...
		

Crossrefs

Row 2 is A000032, row 3 (except the first term) is A000244, row 4 is A006497, row 5 is A206776, row 6 is A172012, row 7 (except the first term) is A000351, row 8 is A087130.

Programs

  • PARI
    T(n, k) = my(x = 4*n+1, y = sqrtint(x), z = y-1+(y % 2)); round(((z+sqrt(x))/2)^k + ((z-sqrt(x))/2)^k);
    matrix(9,9, n, k, T(n-1,k-1)) \\ Michel Marcus, Aug 22 2019
    
  • PARI
    T(n, k) = my(x = 4*n+1, y = sqrtint(x), z=y-1+(y % 2)); v=if(k==0, 2, k==1, z, mapget(m2, n)*((x-z^2)/4) + mapget(m1, n)*z); mapput(m2, n, if(mapisdefined(m1, n), mapget(m1, n), 0)); mapput(m1, n, v); v;
    m1=Map(); m2=Map(); matrix(9, 9, n, k, T(n-1, k-1)) \\ Charles L. Hohn, Aug 26 2019

Formula

For each row n>=0 let x = 4*n+1, y = floor(sqrt(x)), T(n,0)=2, and T(n,1)=y-1+(y % 2), then for each column k>=2: T(n, k-2)*((x-T(n, 1)^2)/4) + T(n, k-1)*T(n, 1). - Charles L. Hohn, Aug 23 2019

A362516 Number of vertex cuts in the n-gear graph.

Original entry on oeis.org

1, 5, 51, 293, 1383, 6017, 25315, 104941, 431775, 1768377, 7218555, 29388325, 119381239, 484031537, 1959295251, 7919693789, 31972642767, 128937189161, 519476334379, 2091181293589, 8412008183079, 33816433653921, 135865503379395, 545598121631437, 2190000348372223
Offset: 1

Views

Author

Eric W. Weisstein, Apr 23 2023

Keywords

Comments

Extended to n = 1 using formula/recurrence.

Crossrefs

Cf. A286188.

Programs

  • Mathematica
    Table[2 (4^n - 1) + 2 n - 4 n^2 - (1/2 (3 - Sqrt[17]))^n - (1/2 (3 + Sqrt[17]))^n, {n, 20}] // Expand
    LinearRecurrence[{10, -34, 44, -13, -14, 8}, {1, 5, 51, 293, 1383, 6017}, 20]
    CoefficientList[Series[(-1 + 5 x - 35 x^2 + 91 x^3 + 20 x^4 + 16 x^5)/((-1 + x)^3 (1 - 7 x + 10 x^2 + 8 x^3)), {x, 0, 20}], x]

Formula

a(n) = 2^(2*n+1) - 1 - A286188(n). - Pontus von Brömssen, Apr 23 2023
a(n) = 2*(4^n - 1) + 2*n - 4*n^2 - ((3 - sqrt(17))/2)^n - ((3 + sqrt(17))/2)^n.
a(n) = 10*a(n-1)-34*a(n-2)+44*a(n-3)-13*a(n-4)-14*a(n-5)+8*a(n-6).
G.f.: x*(-1 + 5*x - 35*x^2 + 91*x^3 + 20*x^4 + 16*x^5)/((-1 + x)^3*(1 - 7*x + 10*x^2 + 8*x^3)).
a(n) = -A206776(n)+2*4^n-2-4*n^2+2*n. - R. J. Mathar, Feb 18 2024

Extensions

More terms (based on data in A286188) from Pontus von Brömssen, Apr 23 2023

A362577 Number of vertex cuts in the n-trapezohedral graph.

Original entry on oeis.org

5, 15, 88, 435, 1957, 8394, 35273, 146795, 607492, 2503687, 10282873, 42103670, 171925709, 700339023, 2846710048, 11549292123, 46778169517, 189188288130, 764162167025, 3083079787091, 12426568931356, 50042249662927, 201366368701441, 809732016511598, 3254128933657397
Offset: 1

Views

Author

Eric W. Weisstein, Apr 25 2023

Keywords

Comments

The n-trapezohedral graph is defined for n >= 3. The sequence has been extended to n=1 using the formula/recurrence. - Andrew Howroyd, May 03 2023

Crossrefs

Programs

  • Mathematica
    Table[LucasL[2 n] - ((3 - Sqrt[17])^n + (3 + Sqrt[17])^n)/2^(n - 1) + 2 n - 4 n^2 + 3 4^n - 2, {n, 20}] //Expand
    LinearRecurrence[{13, -65, 156, -179, 69, 37, -38, 8}, {5, 15, 88, 435, 1957, 8394, 35273, 146795}, 20]
    CoefficientList[Series[(-5 + 50 x - 218 x^2 + 514 x^3 - 577 x^4 + 160 x^5 - 28 x^6 + 8 x^7)/((-1 + x)^3 (-1 + 4 x) (1 - 3 x + x^2) (-1 + 3 x + 2 x^2)), {x, 0, 20}], x]
  • PARI
    Vec((5 - 50*x + 218*x^2 - 514*x^3 + 577*x^4 - 160*x^5 + 28*x^6 - 8*x^7)/((1 - x)^3*(1 - 4*x)*(1 - 3*x + x^2)*(1 - 3*x - 2*x^2)) + O(x^30)) \\ Andrew Howroyd, May 03 2023

Formula

From Andrew Howroyd, May 03 2023: (Start)
a(n) = 3*4^n - 4*n^2 + 2*n - 2 + A005248(n) - 2*A206776(n).
a(n) = 13*a(n-1) - 65*a(n-2) + 156*a(n-3) - 179*a(n-4) + 69*a(n-5) + 37*a(n-6) - 38*a(n-7) + 8*a(n-8) for n > 8.
G.f.: x*(5 - 50*x + 218*x^2 - 514*x^3 + 577*x^4 - 160*x^5 + 28*x^6 - 8*x^7)/((1 - x)^3*(1 - 4*x)*(1 - 3*x + x^2)*(1 - 3*x - 2*x^2)).
(End)

Extensions

a(1)-a(2) prepended and a(15) and beyond from Andrew Howroyd, May 03 2023
Showing 1-9 of 9 results.