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 21-28 of 28 results.

A124039 Triangle read by rows: T(n, k) = (-1)^floor((n+k+2)/2)*(2 - (-1)^(n+k))*A046854(n-1, k-1) with T(1, 1) = 3.

Original entry on oeis.org

3, 3, -1, -1, -3, 1, -3, 2, 3, -1, 1, 6, -3, -3, 1, 3, -3, -9, 4, 3, -1, -1, -9, 6, 12, -5, -3, 1, -3, 4, 18, -10, -15, 6, 3, -1, 1, 12, -10, -30, 15, 18, -7, -3, 1, 3, -5, -30, 20, 45, -21, -21, 8, 3, -1, -1, -15, 15, 60, -35, -63, 28, 24, -9, -3, 1
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Nov 03 2006

Keywords

Examples

			Triangle begins as:
   3;
   3,  -1;
  -1,  -3,   1;
  -3,   2,   3,  -1;
   1,   6,  -3,  -3,   1;
   3,  -3,  -9,   4,   3,  -1;
  -1,  -9,   6,  12,  -5,  -3,   1;
  -3,   4,  18, -10, -15,   6,   3, -1;
   1,  12, -10, -30,  15,  18,  -7, -3,  1;
   3,  -5, -30,  20,  45, -21, -21,  8,  3, -1;
  -1, -15,  15,  60, -35, -63,  28, 24, -9, -3,  1;
		

Crossrefs

Columns include: (-1)^n*A112030(n-1) (k=1), (-1)^floor((n+1)/2)*A064455(n) (k=2).

Programs

  • Magma
    A124039:= func< n,k | (-1)^Floor((n+k+2)/2)*(2-(-1)^(n+k))*Binomial(Floor((n+k-2)/2), k-1) + 2*0^(n-1) >;
    [A124039(n, k): k in [1..n], n in [1..12]]; // G. C. Greubel, Jan 30 2025
  • Mathematica
    (* First program *)
    f[n_, m_, d_]:= If[n==m && n>1 && m>1, 0, If[n==m-1 || n==m+1, -1, If[n==m== 1, 3, 0]]];
    M[d_]:= Table[T[n,m,d], {n,d}, {m,d}];
    A124039[n_]:= Join[{M[1]}, CoefficientList[Det[M[n] - x*IdentityMatrix[n]], x]];
    Table[A124039[n], {n,12}]//Flatten
    (* Second program *)
    A124039[n_, k_]:= (-1)^Floor[(n+k+2)/2]*(2-(-1)^(n-k))*Binomial[Floor[(n+k- 2)/2], k-1] +2*Boole[n==1];
    Table[T[n,k], {n,12}, {k,n}]//Flatten (* G. C. Greubel, Jan 30 2025 *)
  • SageMath
    @CachedFunction
    def t(n,k):
        if n< 0: return 0
        if n==0: return 1 if k == 0 else 0
        h = 3*t(n-1,k) if n==1 else 0
        return t(n-1,k-1) - t(n-2,k) - h
    def A124039(n,k): return t(n,k) + 2*0^n
    print([[A124039(n,k) for k in range(n+1)] for n in range(13)]) # Peter Luschny, Nov 20 2012
    
  • SageMath
    def A124039(n,k): return (-1)^((n+k+2)//2)*(2-(-1)^(n+k))*binomial((n+k-2)//2, k-1) + 2*0^(n-1)
    print(flatten([[A124039(n,k) for k in range(1,n+1)] for n in range(1,13)])) # G. C. Greubel, Jan 30 2025
    

Formula

T(n, k) = (-1)^floor((n+k+2)/2)*(2 - (-1)^(n+k))*A046854(n-1,k-1) + 2*[n=1]. - G. C. Greubel, Jan 30 2025

Extensions

Edited by G. C. Greubel, Jan 30 2025

A136571 Irregular triangle of coefficients of the minimal polynomial of 2*cos(2*Pi/n) in decreasing powers.

Original entry on oeis.org

1, -2, 1, 2, 1, 1, 1, 0, 1, 1, -1, 1, -1, 1, 1, -2, -1, 1, 0, -2, 1, 0, -3, 1, 1, -1, -1, 1, 1, -4, -3, 3, 1, 1, 0, -3, 1, 1, -5, -4, 6, 3, -1, 1, -1, -2, 1, 1, -1, -4, 4, 1, 1, 0, -4, 0, 2, 1, 1, -7, -6, 15, 10, -10, -4, 1, 1, 0, -3, -1, 1, 1, -8, -7, 21
Offset: 1

Views

Author

T. D. Noe, Jan 07 2008

Keywords

Comments

The degree of the n-th polynomial is A023022(n), the half-totient function for n>2. These polynomials are integral, monic and irreducible over the integers. Hence 2*cos(2*Pi/n) is an algebraic integer. When n is prime, the n-th row is the same as the n-th row of A066170. Carlitz and Thomas give an algorithm for computing these polynomials.

Examples

			x-2, x+2, x+1, x, x^2+x-1, x-1, x^3+x^2-2x-1, x^2-2, x^3-3x+1, x^2-x-1
		

Programs

  • Mathematica
    Flatten[Table[Reverse[CoefficientList[MinimalPolynomial[2Cos[2Pi/n],x],x]], {n,25}]]

A091650 Let M = the 4 X 4 matrix [0 1 0 0 / 0 0 1 0 / 0 0 0 1 / -1 -1 3 2]. Set seed vector = [1 1 1 1] = first row, then take M*[1 1 1 1] = [1 1 1 3] then M * [1 1 1 3], etc. Sequence gives terms in rightmost column.

Original entry on oeis.org

1, 3, 7, 21, 59, 171, 491, 1415, 4073, 11729, 33771, 97241, 279993, 806209, 2321385, 6684163, 19246279, 55417453, 159568195, 459458307, 1322957467, 3809304207, 10968454313, 31582405473, 90937912211, 261845282321, 753953441489, 2170922412257, 6250921954449
Offset: 1

Views

Author

Gary W. Adamson, Jan 25 2004

Keywords

Comments

a(n)/a(n-1) tends to a 9-Gon diagonal.
The other 3 columns are offsets of 1, 3, 7, 21, 59, ... starting with 1's.
The characteristic equation of the 4 X 4 matrix is x^4 - 2x^3 - 3x^4 + x + 1 (coefficients may be found in A066170) with roots 2.879385241..., -1, -.5320888862... and .65270364466... An alternative matrix giving the same eigenvalues (refer to A046854) relates to the 9-Gon: [1 1 1 1 / 1 1 1 0 / 1 1 0 0 / 1 0 0 0] since the eigenvalue 2.8793852...is the longest diagonal of the 9-Gon given edge = 1. Or, 2.879385... = 1/(2*cos(k*Pi/9)), k = 4.

Examples

			a(5) = 59 since M*[1 1 1 1] then 4 iterates = [3 7 21 59]. a(5) = rightmost term.
a(10)/a(9) = 11729/4073 = 2.8796955...
		

Crossrefs

Programs

  • Mathematica
    Rest[CoefficientList[Series[x (1+x-2x^2-x^3)/(1-2x-3x^2+x^3+x^4),{x,0,40}],x]] (* or *) LinearRecurrence[{2,3,-1,-1},{1,3,7,21},40] (* Harvey P. Dale, Feb 17 2012 *)
  • PARI
    Vec((1+x-2*x^2-x^3)/(1-2*x-3*x^2+x^3+x^4)+O(x^99)) \\ Charles R Greathouse IV, Jan 31 2012

Formula

G.f.: x*(1+x-2*x^2-x^3)/(1-2*x-3*x^2+x^3+x^4). - Colin Barker, Jan 31 2012
a(1)=1, a(2)=3, a(3)=7, a(4)=21, a(n)=2*a(n-1)+3*a(n-2)-a(n-3)-a(n-4). - Harvey P. Dale, Feb 17 2012

Extensions

More terms from Harvey P. Dale, Feb 17 2012

A122602 a(1) = 1; a(2) = 0; a(3) = 0; a(4) = 0; a(5) = 0; a(6) = 0; a(7) = 0; a(8) = 0; a(9) = 0; a(10) = 0; a(n) = a(n - 1) + 9a(n - 2) - 8a(n - 3) - 28a(n - 4) + 21a(n - 5) + 35a(n - 6) - 20a(n - 7) - 15a(n - 8) + 5a(n - 9) + a(n - 10) for n >= 11.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 10, 11, 65, 77, 350, 440, 1700, 2244, 7752, 10659, 33915, 48279, 144210, 211508, 600875, 904475, 2466750, 3798795, 10015005, 15737864, 40320149, 64512209, 161280568, 262255753, 641885440, 1059105390, 2544612396
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 20 2006

Keywords

Crossrefs

Cf. A066170.

Programs

  • Maple
    a[1]:=1: a[2]:=0: a[3]:=0: a[4]:=0: a[5]:=0: a[6]:=0: a[7]:=0: a[8]:=0: a[9]:=0: a[10]:=0: for n from 11 to 39 do a[n]:=a[n-1]+9*a[n-2]-8*a[n-3]-28*a[n-4]+21*a[n-5]+35*a[n-6]-20*a[n-7]-15*a[n-8]+5*a[n-9]+a[n-10] od: seq(a[n],n=1..39);
  • Mathematica
    M = {{0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 5, -15, -20, 35, 21, -28, -8, 9, 1}}; v[1] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0}; v[n_] := v[n] = M.v[n - 1] a = Table[Floor[v[n][[1]]], {n, 1, 50}]
    LinearRecurrence[{1,9,-8,-28,21,35,-20,-15,5,1},{1,0,0,0,0,0,0,0,0,0},50] (* Harvey P. Dale, Dec 03 2014 *)

Formula

G.f.:((5*x^4-5*x^2+1)*(x^5-3*x^4-3*x^3+4*x^2+x-1))/((x-1)*(x^3-2*x^2-x+1)*(x^6+8*x^5+8*x^4-6*x^3-6*x^2+x+1)). [Maksym Voznyy (voznyy(AT)mail.ru), Jul 28 2009]

Extensions

Edited by N. J. A. Sloane, Oct 08 2006

A122605 Expansion of -x*(2*x - 1)*(2*x^2 - 1)*(x^3 + 2*x^2 - x - 1)/((x - 1)*(x^2 + x - 1)*(x^4 - 4*x^3 - 4*x^2 + x + 1)).

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, -1, -1, -7, -8, -35, -44, -154, -208, -637, -910, -2548, -3808, -9996, -15504, -38760, -62015, -149225, -245135, -572010, -961125, -2186886, -3746886, -8348172, -14547183, -31842580, -56309764, -121415344, -217478888, -462925232, -838520240, -1765205473, -3228800413
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 20 2006

Keywords

Crossrefs

Cf. A066170.

Programs

  • Mathematica
    LinearRecurrence[{1,6,-5,-10,6,4,-1},{1,0,0,0,0,0,0},60] (* Harvey P. Dale, May 02 2011 *)

Formula

a(0)=1, a(1)=a(2)=a(3)=a(4)=a(5)=a(6)=0; for n>6, a(n) = a(n-1) + 6*a(n-2) - 5*a(n-3) - 10*a(n-4) + 6*a(n-5) + 4*a(n-6) - a(n-7). - Harvey P. Dale, May 02 2011
G.f.: -x*(2*x-1)*(2*x^2-1)*(x^3+2*x^2-x-1)/((x-1)*(x^2+x-1)*(x^4-4*x^3-4*x^2+x+1)). - Colin Barker, Nov 08 2012

Extensions

Edited by N. J. A. Sloane, Feb 11 2007
Definition changed using Barker's g.f. by Bruno Berselli, Sep 19 2017

A122607 Expansion of x*(8*x^5 + 5*x^4 - x^3 - 5*x^2 - 1)/(x^6 + 3*x^5 + 6*x^4 + 4*x^3 - 5*x^2 + x - 1).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 10, 19, -17, -62, 163, 550, -548, -3050, 2665, 19450, -7550, -113534, 8308, 667423, 187462, -3800825, -2366747, 21303154, 21068938, -116488961, -162036530, 621601885, 1153785034, -3216794309, -7799929064, 16026195376, 50784142789, -75764359214, -320876463932
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 20 2006

Keywords

Comments

Obtained as the top element of the vector resulting from multiplying the n-th power of the 6 X 6 matrix [[0, 1, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 1], [1, 3, 6, 4, -5, 1]] with the column vector which contains only 1's.

Crossrefs

Cf. A066170.

Programs

  • Mathematica
    M = {{0, 1, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 1}, {1, 3, 6, 4, -5, 1}}; v[1] = {1, 1, 1, 1, 1, 1}; v[n_] := v[n] = M.v[n - 1] a = Table[Floor[v[n][[1]]], {n, 1, 50}]
    LinearRecurrence[{1,-5,4,6,3,1},{1,1,1,1,1,1},40] (* Harvey P. Dale, Feb 17 2024 *)

Formula

G.f.: x*(8*x^5+5*x^4-x^3-5*x^2-1)/(x^6+3*x^5+6*x^4+4*x^3-5*x^2+x-1). - Colin Barker, Nov 08 2012

Extensions

Edited by N. J. A. Sloane, Sep 24 2006
Definition changed using Barker's g.f. by Bruno Berselli, Sep 19 2017

A122608 a(1) = 1; a(2) = 1; a(3) = 1; a(4) = 1; a(5) = 1; a(n) = a(n-1)+4a(n-2)-3a(n-3)-3a(n-4)+a(n-5) for n >= 6.

Original entry on oeis.org

1, 1, 1, 1, 1, 0, -1, -6, -12, -32, -59, -134, -244, -519, -948, -1949, -3586, -7225, -13397, -26640, -49744, -98024, -184114, -360455, -680247, -1325397, -2510702, -4874298, -9260629, -17929771, -34142684, -65967689, -125841523, -242755543, -463720287, -893457507, -1708515146
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 20 2006

Keywords

Crossrefs

Cf. A066170.

Programs

  • Maple
    a[1]:=1: a[2]:=1: a[3]:=1: a[4]:=1: a[5]:=1: for n from 6 to 37 do a[n]:=a[n-1]+4*a[n-2]-3*a[n-3]-3*a[n-4]+a[n-5] od: seq(a[n],n=1..37);
  • Mathematica
    M = {{0, 1, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 0, 1, 0}, {0, 0, 0, 0, 1}, {1, -3, -3, 4, 1}}; v[1] = {1, 1, 1, 1, 1}; v[n_] := v[n] = M.v[n - 1] a = Table[Floor[v[n][[1]]], {n, 1, 50}]
    nxt[{a_,b_,c_,d_,e_}]:={b,c,d,e,e+4d-3c-3b+a}; NestList[nxt,{1,1,1,1,1},50][[;;,1]] (* Harvey P. Dale, Aug 02 2024 *)

Formula

G.f.: -(2*x-1)*(x+1)*(x^2-x-1)/(-1+x^5-3*x^4-3*x^3+4*x^2+x). [Maksym Voznyy (voznyy(AT)mail.ru), Aug 11 2009]

Extensions

Edited by N. J. A. Sloane, Oct 08 2006

A122611 G.f.: 1/(1 - 7 x + 15 x^2 - 6 x^3 - 11 x^4 + 6 x^5 + x^6).

Original entry on oeis.org

1, 7, 34, 139, 516, 1802, 6039, 19657, 62634, 196404, 608361, 1866462, 5683236, 17200871, 51807242, 155421557, 464755958, 1386055506, 4124569714, 12251283960, 36334754000, 107624090145, 318444202635, 941387240040
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 20 2006

Keywords

Crossrefs

Cf. A066170.

Programs

  • Mathematica
    b = {1, -7, 15, -6, -11, 6, 1}; p[x_] := Sum[x^(n - 1)*b[[8 - n]], {n, 1, 7}] q[x_] := ExpandAll[x^6*p[1/x]] Table[ SeriesCoefficient[ Series[x/q[x], {x, 0, 30}], n], {n, 0, 30}]

Extensions

Edited by N. J. A. Sloane, Sep 21 2006
Previous Showing 21-28 of 28 results.