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-6 of 6 results.

A122099 a(n) = -3*a(n-1) + a(n-3) for n>2, with a(0)=1, a(1)=1, a(2)=0.

Original entry on oeis.org

1, 1, 0, 1, -2, 6, -17, 49, -141, 406, -1169, 3366, -9692, 27907, -80355, 231373, -666212, 1918281, -5523470, 15904198, -45794313, 131859469, -379674209, 1093228314, -3147825473, 9063802210, -26098178316, 75146709475, -216376326215, 623030800329, -1793945691512, 5165460748321
Offset: 0

Views

Author

Philippe Deléham, Oct 18 2006

Keywords

Crossrefs

Cf. A122100.

Programs

  • GAP
    a:=[1,1,0];; for n in [4..40] do a[n]:=-3*a[n-1]+a[n-3]; od; a; # G. C. Greubel, Oct 02 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1+4*x+3*x^2)/(1+3*x-x^3) )); // G. C. Greubel, Oct 02 2019
    
  • Maple
    seq(coeff(series((1+4*x+3*x^2)/(1+3*x-x^3), x, n+1), x, n), n = 0..40); # G. C. Greubel, Oct 02 2019
  • Mathematica
    Transpose[NestList[{#[[2]],Last[#],First[#]-3Last[#]}&, {1,1,0},35]][[1]]  (* Harvey P. Dale, Mar 13 2011 *)
    LinearRecurrence[{-3,0,1}, {1,1,0}, 40] (* G. C. Greubel, Oct 02 2019 *)
  • PARI
    Vec((1+4*x+3*x^2)/(1+3*x-x^3)+O(x^40)) \\ Charles R Greathouse IV, Jan 17 2012
    
  • Sage
    def A122099_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P((1+4*x+3*x^2)/(1+3*x-x^3)).list()
    A122099_list(40) # G. C. Greubel, Oct 02 2019
    

Formula

G.f.: (1+4*x+3*x^2)/(1+3*x-x^3).
a(n) = (-1)^n*A122100(n). - R. J. Mathar, Sep 27 2014

A123942 The (1,4)-entry in the 4 X 4 matrix M^n, where M={{3, 2, 1, 1}, {2, 1, 1, 0}, {1, 1, 0, 0}, {1, 0, 0, 0}} (n>=0).

Original entry on oeis.org

0, 1, 3, 15, 71, 340, 1626, 7778, 37205, 177966, 851280, 4072001, 19477953, 93170570, 445670811, 2131815570, 10197297001, 48777608903, 233322137235, 1116069871981, 5338593130960, 25536552265626, 122151189577128, 584296304368075, 2794914830384226
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Oct 25 2006

Keywords

References

  • Rosenblum and Rovnyak, Hardy Classes and Operator Theory, Dover, New York, 1985, page 26

Crossrefs

Programs

  • GAP
    a:=[0,1,3,15];; for n in [5..30] do a[n]:=4*a[n-1]+4*a[n-2]-a[n-3] -a[n-4]; od; a; # G. C. Greubel, Aug 05 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 30); [0] cat Coefficients(R!( x*(1-x-x^2)/(1-4*x-4*x^2+x^3+x^4) )); // G. C. Greubel, Aug 05 2019
    
  • Maple
    with(linalg): M[1]:=matrix(4,4,[3,2,1,1,2,1,1,0,1,1,0,0,1,0,0,0]): for n from 2 to 30 do M[n]:=multiply(M[1],M[n-1]) od: 0, seq(M[n][1,4], n=1..30);
    a[0]:=0: a[1]:=1: a[2]:=3: a[3]:=15: for n from 4 to 30 do a[n]:=4*a[n-1] +4*a[n-2]-a[n-3]-a[n-4] od: seq(a[n], n=0..30);
  • Mathematica
    M = {{3,2,1,1}, {2,1,1,0}, {1,1,0,0}, {1,0,0,0}}; v[1] = {0,0,0,1}; v[n_]:= v[n] = M.v[n-1]; Table[v[n][[1]], {n, 30}]
    LinearRecurrence[{4,4,-1,-1}, {0,1,3,15}, 30] (* G. C. Greubel, Aug 05 2019 *)
  • PARI
    concat([0], Vec(x*(1-x-x^2)/(1-4*x-4*x^2+x^3+x^4) + O(x^30))) \\ Colin Barker, Oct 18 2013
    
  • Sage
    (x*(1-x-x^2)/(1-4*x-4*x^2+x^3+x^4)).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Aug 05 2019
    

Formula

a(n) = 4*a(n-1) + 4*a(n-2) - a(n-3) - a(n-4) for n>=4 (follows from the minimal polynomial of the matrix M).
G.f.: x*(1-x-x^2)/(1-4*x-4*x^2+x^3+x^4). - Colin Barker, Oct 18 2013

Extensions

Edited by N. J. A. Sloane, Dec 04 2006
More terms from Colin Barker, Oct 18 2013

A215448 a(0)=1, a(1)=0, a(n) = a(n-1) + a(n-2) + Sum_{i=0...n-1} a(i).

Original entry on oeis.org

1, 0, 2, 5, 15, 43, 124, 357, 1028, 2960, 8523, 24541, 70663, 203466, 585857, 1686908, 4857258, 13985917, 40270843, 115955271, 333879896, 961368845, 2768151264, 7970573896, 22950352843, 66082907265, 190278147899, 547884090854, 1577569365297, 4542429947992
Offset: 0

Views

Author

Alex Ratushnyak, Aug 10 2012

Keywords

Comments

For the general recurrence X(n) = 3*X(n-1) - X(n-3) we get Sum_{k=3..n} X(k) = 3*Sum_{k=2..n-1} X(k) - Sum_{k=0..n-3} X(k), which implies the following summation formula: X(n) - X(n-1) - X(n-2) - X(2) + X(1) + X(0) = Sum_{k=2..n-1} X(k). Similarly from the formula X(n) + X(n-3) = 3*X(n-1) we deduce the following relations: Sum_{k=0..2*n-1} X(3*k) = 3*Sum_{k=0..n-1} X(6*k+2), Sum_{k=0..2*n-1} X(3*k+1) = 3*Sum_{k=1..n} X(6*k), and Sum_{k=0..2*n-1} X(3*k+2) = 3*Sum_{k=1..n} X(6*k-2). Lastly from the formula X(n)-X(n-1)=(X(n-1)-X(n-3))+X(n-1) we obtain the relations: Sum_{k=2..2*n+1} (-1)^(k-1)*X(k) = X(2*n) - X(0) + Sum_{k=1..n} X(2*k) and Sum_{k=3..2n} (-1)^k*X(k) = X(2*n-1) - X(1) + Sum_{k=2..n} X(2*k-1). - Roman Witula, Aug 27 2012

Crossrefs

Cf. A052536: same formula, seed {0, 1}, first term removed.
Cf. A122100: same formula, seed {0,-1}, first two terms removed.
Cf. A052545: same formula, seed {1, 1}.

Programs

  • Mathematica
    LinearRecurrence[{3,0,-1},{1,0,2},30] (* Harvey P. Dale, Jan 26 2017 *)
  • Python
    a = [1]*33
    a[1]=0
    sum = a[0]+a[1]
    for n in range(2,33):
        print(a[n-2], end=', ')
        a[n] = a[n-1] + a[n-2] + sum
        sum += a[n]

Formula

a(0)=1, a(1)=0, for n>=2, a(n) = a(n-1) + a(n-2) + (a(0)+...+a(n-1)).
Conjecture: a(n) = +3*a(n-1) -a(n-3) = A076264(n) -3 *A076264(n-1) +2*A076264(n-2). G.f. (2*x-1)*(x-1) / ( 1-3*x+x^3 ). - R. J. Mathar, Aug 11 2012
Proof of the above conjecture: we have a(n) - a(n-1) = a(n-1) + a(n-2) + (a(0) + ... + a(n-1)) - a(n-2) - a(n-3) - (a(0) + ... + a(n-2)), which after simple algebra implies a(n) - a(n-1) = 2*a(n-1) - a(n-3), so the Mathar's formula holds true (see also Witula's comment above). - Roman Witula, Aug 27 2012

A123941 The (1,2)-entry in the 3 X 3 matrix M^n, where M = {{2, 1, 1}, {1, 1, 0}, {1, 0, 0}}.

Original entry on oeis.org

0, 1, 3, 9, 26, 75, 216, 622, 1791, 5157, 14849, 42756, 123111, 354484, 1020696, 2938977, 8462447, 24366645, 70160958, 202020427, 581694636, 1674922950, 4822748423, 13886550633, 39984728949, 115131438424, 331507764639, 954538564968, 2748484256480
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Oct 25 2006

Keywords

Comments

Essentially the same as A076264. - Tom Edgar, May 12 2015

References

  • Rosenblum and Rovnyak, Hardy Classes and Operator Theory, Dover, New York, 1985, page 26

Crossrefs

Programs

  • GAP
    a:=[0,1,3];; for n in [4..30] do a[n]:=3*a[n-1]-a[n-3]; od; a; # Muniru A Asiru, Oct 28 2018
    
  • Magma
    R:=PowerSeriesRing(Integers(), 30); [0] cat Coefficients(R!( x/(1-3*x+x^3) )); // G. C. Greubel, Aug 05 2019
    
  • Maple
    with(linalg): M[1]:=matrix(3,3,[2,1,1,1,1,0,1,0,0]): for n from 2 to 30 do M[n]:=multiply(M[1],M[n-1]) od: 0,seq(M[n][1,2], n=1..30);
    a[0]:=0: a[1]:=1: a[2]:=3: for n from 3 to 30 do a[n]:=3*a[n-1]-a[n-3] od: seq(a[n], n=0..30);
  • Mathematica
    M = {{2,1,1}, {1,1,0}, {1,0,0}}; v[1] = {0,0,1}; v[n_]:= v[n] =M.v[n-1];Table[v[n][[2]], {n, 30}]
    LinearRecurrence[{3,0,-1}, {0,1,3}, 30] (* G. C. Greubel, Aug 05 2019 *)
  • PARI
    my(x='x+O('x^30)); concat([0], Vec(x/(1-3*x+x^3))) \\ G. C. Greubel, Aug 05 2019
    
  • Sage
    (x/(1-3*x+x^3)).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Aug 05 2019

Formula

a(n) = 3*a(n-1) - a(n-3), a(0)=0, a(1)=1, a(2)=3 (follows from the minimal polynomial x^3-3x^2+1 of the matrix M).
a(n) = A076264(n-1). - R. J. Mathar, Jun 18 2008
G.f.: x/(1 - 3*x + x^3). - Arkadiusz Wesolowski, Oct 29 2012
a(n) = A018919(n-2) for n >= 2. - Georg Fischer, Oct 28 2018

Extensions

Edited by N. J. A. Sloane, Nov 07 2006

A123943 The (1,5)-entry in the 5 X 5 matrix M^n, where M={{5, 3, 2, 1, 1}, {3, 2, 1, 1, 0}, {2, 1, 1, 0, 0}, {1, 1, 0, 0, 0}, {1, 0, 0, 0, 0}}.

Original entry on oeis.org

0, 1, 5, 40, 315, 2490, 19681, 155563, 1229604, 9719061, 76821600, 607214857, 4799560053, 37936780428, 299860673343, 2370164848026, 18734305316497, 148080078051971, 1170457572108040, 9251554605638681, 73126326541645648, 578006601205833441
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Oct 25 2006

Keywords

References

Crossrefs

Programs

  • GAP
    a:=[0,1,5,40,315];; for n in [6..30] do a[n]:=8*a[n-1]-6*a[n-3] +a[n-5]; od; a; # G. C. Greubel, Aug 05 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 30); [0] cat Coefficients(R!( x*(1-3*x+x^3)/(1-8*x+6*x^3-x^5) )); // G. C. Greubel, Aug 05 2019
    
  • Maple
    with(linalg): M[1]:=matrix(5,5,[5,3,2,1,1,3,2,1,1,0,2,1,1,0,0,1,1,0,0,0,1,0,0,0,0]): for n from 2 to 30 do M[n]:=multiply(M[1],M[n-1]) od: 0,seq(M[n][1,5],n=1..30);
    a[0]:=0: a[1]:=1: a[2]:=5: a[3]:=40: a[4]:=315: for n from 5 to 30 do a[n]:=8*a[n-1]-6*a[n-3]+a[n-5] od: seq(a[n],n=0..30);
    # third Maple program:
    a:= n-> (<<0|1|0|0|0>, <0|0|1|0|0>, <0|0|0|1|0>, <0|0|0|0|1>,
             <1|0|-6|0|8>>^n. <<0, 1, 5, 40, 315>>)[1, 1]:
    seq(a(n), n=0..30);  # Alois P. Heinz, Aug 05 2019
  • Mathematica
    M = {{5,3,2,1,1}, {3,2,1,1,0}, {2,1,1,0,0}, {1,1,0,0,0}, {1,0,0,0,0}}; v[1] = {0,0,0,0,1}; v[n_]:= v[n] = M.v[n-1]; Table[v[n][[1]], {n, 30}]
    LinearRecurrence[{8,0,-6,0,1}, {0,1,5,40,315}, 30] (* G. C. Greubel, Aug 05 2019 *)
  • PARI
    concat(0, Vec(x*(1-3*x+x^3)/(1-8*x+6*x^3-x^5) + O(x^30))) \\ Colin Barker, Mar 03 2017
    
  • Sage
    (x*(1-3*x+x^3)/(1-8*x+6*x^3-x^5)).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Aug 05 2019
    

Formula

a(n) = 8*a(n-1) - 6*a(n-3) + a(n-5) for n>=5 (follows from the minimal polynomial of the matrix M).
G.f.: x*(1 - 3*x + x^3) / (1 - 8*x + 6*x^3 - x^5). - Colin Barker, Mar 03 2017

Extensions

Edited by N. J. A. Sloane, Dec 04 2006

A049126 Revert transform of ((x - 1)(3x - 1))/(1 - 3x + x^3).

Original entry on oeis.org

1, 1, 2, 6, 22, 90, 393, 1789, 8378, 40050, 194492, 956448, 4752519, 23822571, 120315345, 611644737, 3127389106, 16072642890, 82981119252, 430187414196, 2238469102212, 11687227631892, 61208286479382, 321465732705594
Offset: 1

Views

Author

Keywords

Examples

			G.f. = x + x^2 + 2*x^3 + 6*x^4 + 22*x^5 + 90*x^6 + 393*x^7 + 1789*x^8 + ...
		

Crossrefs

Cf. A122100.

Programs

  • Mathematica
    Rest[CoefficientList[InverseSeries[Series[x*((x - 1)(3x - 1))/(1 - 3x + x^3), {x, 0, 40}], x], x]] (* Vaclav Kotesovec, Jan 02 2021 *)
  • PARI
    {a(n) = if( n<1, 0, polcoeff( serreverse(x * (1 - 4*x + 3*x^2) / (1 - 3*x + x^3) + x * O(x^n)), n))}; /* Michael Somos, May 11 2012 */

Formula

Revert transform of A122100 offset 1. - Michael Somos, May 11 2012
Recurrence: 12*(n-1)*n*(117*n - 604)*a(n) = 4*(n-1)*(4329*n^2 - 29719*n + 39384)*a(n-1) - 3*(23985*n^3 - 230056*n^2 + 679659*n - 630308)*a(n-2) + 3*(38961*n^3 - 437004*n^2 + 1609875*n - 1955812)*a(n-3) - 27*(n-4)*(2223*n^2 - 18496*n + 38133)*a(n-4) + 81*(n-5)*(n-4)*(117*n - 487)*a(n-5). - Vaclav Kotesovec, Jan 02 2021
a(n) ~ 3^(n - 1/4) * (2 + sqrt(3))^(n - 3/2) / (sqrt(Pi) * n^(3/2) * 2^(n + 1/2)). - Vaclav Kotesovec, Jan 02 2021
Showing 1-6 of 6 results.