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.

User: Kai Wang

Kai Wang's wiki page.

Kai Wang has authored 28 sequences. Here are the ten most recent ones:

A322504 a(n) = -4*a(n-1) - 3*a(n-2) + a(n-3), a(0) = 1, a(1) = -2, a(2) = 4.

Original entry on oeis.org

1, -2, 4, -9, 22, -57, 153, -419, 1160, -3230, 9021, -25234, 70643, -197849, 554233, -1552742, 4350420, -12189221, 34152882, -95693445, 268125913, -751270435, 2105010556, -5898105006, 16526117921, -46305146110, 129744125671, -363534946433, 1018602262609, -2854060085466, 7996898607604
Offset: 0

Author

Kai Wang, Jan 10 2019

Keywords

Comments

Let {X,Y,Z} be the roots of the cubic equation t^3 + at^2 + bt + c = 0 where {a, b, c} are integers.
Let {u, v, w} be three numbers such that {u + v + w, u*X + v*Y + w*Z, u*X^2 + v*Y^2 + w*Z^2} are integers.
Then {p(n) = u*X^n + v*Y^n + w*Z^n | n = 0, 1, 2, ...} is an integer sequence with the recurrence relation: p(n) = -a*p(n-1) - b*p(n-2) - c*p(n-3).
Let k = Pi/7.
This sequence has (a, b, c) = (4, 3, -1), (u, v, w) = (1/(sqrt(7)*tan(8k)), 1/(sqrt(7)*tan(2k)), 1/(sqrt(7)*tan(4k))).
A215404: (a, b, c) = (4, 3, -1), (u, v, w) = (1/(sqrt(7)*tan(2k)), 1/(sqrt(7)*tan(4k)), 1/(sqrt(7)*tan(8k))).
A136776: (a, b, c) = (4, 3, -1), (u, v, w) = (1/(sqrt(7)*tan(4k)), 1/(sqrt(7)*tan(8k)), 1/(sqrt(7)*tan(2k))).
X = (sin(2k)*sin(2k))/(sin(4k)*sin(8k)), Y = (sin(4k)*sin(4k))/(sin(8k)*sin(2k)), Z = (sin(8k)*sin(8k))/(sin(2k)*sin(4k)).

Crossrefs

Programs

  • Magma
    I:=[1,-2,4]; [n le 3 select I[n] else -4*Self(n-1) - 3*Self(n-2) + Self(n-3): n in [1..31]]; // Vincenzo Librandi, Jan 13 2019
  • Mathematica
    LinearRecurrence[{-4,-3,1},{1,-2,4},50] (* Stefano Spezia, Jan 11 2019 *)
    RecurrenceTable[{a[0]==1, a[1]==-2, a[2]==4, a[n]==-4 a[n-1]-3 a[n-2]+a[n-3]}, a, {n, 30}] (* Vincenzo Librandi, Jan 13 2019 *)
  • PARI
    Vec((1 + 2*x - x^2) / (1 + 4*x + 3*x^2 - x^3) + O(x^30)) \\ Colin Barker, Jan 11 2019
    

Formula

G.f.: (1 + 2*x - x^2) / (1 + 4*x + 3*x^2 - x^3). - Colin Barker, Jan 11 2019

A321175 a(n) = -a(n-1) + 2*a(n-2) + a(n-3), a(0) = -1, a(1) = -2, a(2) = 3.

Original entry on oeis.org

-1, -2, 3, -8, 12, -25, 41, -79, 136, -253, 446, -816, 1455, -2641, 4735, -8562, 15391, -27780, 50000, -90169, 162389, -292727, 527336, -950401, 1712346, -3085812, 5560103, -10019381, 18053775, -32532434, 58620603
Offset: 0

Author

Kai Wang, Jan 10 2019

Keywords

Comments

Let {X,Y,Z} be the roots of the cubic equation t^3 + at^2 + bt + c = 0 where {a, b, c} are integers.
Let {u, v, w} be three numbers such that {u + v + w, u*X + v*Y + w*Z, u*X^2 + v*Y^2 + w*Z^2} are integers.
Then {p(n) = u*X^n + v*Y^n + w*Z^n | n = 0, 1, 2, ...} is an integer sequence with the recurrence relation: p(n) = -a*p(n-1) - b*p(n-2) - c*p(n-3).
Let k = Pi/7.
This sequence has (a, b, c) = (1, -2, -1), (u, v, w) = (2*cos(2k), 2*cos(4k), 2*cos(8k)).
A094648: (a, b, c) = (1, -2, -1), (u, v, w) = (2*cos(8k), 2*cos(2k), 2*cos(4k)).
A321461 : (a, b, c) = (1, -2, -1), (u, v, w) = (2*cos(4k), 2*cos(8k), 2*cos(2k)).
X = sin(2k)/sin(8k), Y = sin(4k)/sin(2k), Z = sin(8k)/sin(4k).

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{-1,2,1},{-1,-2,3},50] (* Stefano Spezia, Jan 11 2019 *)
  • PARI
    Vec(-(1 + 3*x - 3*x^2) / (1 + x - 2*x^2 - x^3) + O(x^30)) \\ Colin Barker, Jan 11 2019

Formula

G.f.: -(1 + 3*x - 3*x^2) / (1 + x - 2*x^2 - x^3). - Colin Barker, Jan 11 2019

A321174 a(n) = -2*a(n-1) + a(n-2) + a(n-3), a(0) = -1, a(1) = -4, a(2) = 5.

Original entry on oeis.org

-1, -4, 5, -15, 31, -72, 160, -361, 810, -1821, 4091, -9193, 20656, -46414, 104291, -234340, 526557, -1183163, 2658543, -5973692, 13422764, -30160677, 67770426, -152278765, 342167279, -768842897, 1727574308, -3881824234, 8722379879, -19599009684, 44038575013
Offset: 0

Author

Kai Wang, Jan 10 2019

Keywords

Comments

Let {X,Y,Z} be the roots of the cubic equation t^3 + at^2 + bt + c = 0 where {a, b, c} are integers.
Let {u, v, w} be three numbers such that {u + v + w, u*X + v*Y + w*Z, u*X^2 + v*Y^2 + w*Z^2} are integers.
Then {p(n) = u*X^n + v*Y^n + w*Z^n | n = 0, 1, 2, ...} is an integer sequence with the recurrence relation: p(n) = -a*p(n-1) - b*p(n-2) - c*p(n-3).
Let k = Pi/7.
This sequence has (a, b, c) = (2, -1, -1), (u, v, w) = (2*cos(8k), 2*cos(2k), 2*cos(4k)).
A033304, A274975: (a, b, c) = (2, -1, -1), (u, v, w) = (2*cos(2k), 2*cos(4k), 2*cos(8k)).
A321173 : (a, b, c) = (2, -1, -1), (u, v, w) = (2*cos(4k), 2*cos(8k), 2*cos(2k)).
X = sin(2k)/sin(4k), Y = sin(4k)/sin(8k), Z = sin(8k)/sin(2k).

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{-2,1,1},{-1,-4,5},50] (* Stefano Spezia, Jan 11 2019 *)
  • PARI
    Vec(-(1 + 6*x + 2*x^2) / (1 + 2*x - x^2 - x^3) + O(x^30)) \\ Colin Barker, Jan 11 2019

Formula

G.f.: -(1 + 6*x + 2*x^2) / (1 + 2*x - x^2 - x^3). - Colin Barker, Jan 11 2019

A321173 a(n) = -2*a(n-1) + a(n-2) + a(n-3), a(0) = -1, a(1) = 3, a(2) = -9.

Original entry on oeis.org

-1, 3, -9, 20, -46, 103, -232, 521, -1171, 2631, -5912, 13284, -29849, 67070, -150705, 338631, -760897, 1709720, -3841706, 8632235, -19396456, 43583441, -97931103, 220049191, -494446044, 1111010176, -2496417205, 5609398542, -12604204113, 28321389563, -63637584697
Offset: 0

Author

Kai Wang, Jan 10 2019

Keywords

Comments

Let {X,Y,Z} be the roots of the cubic equation t^3 + at^2 + bt + c = 0 where {a, b, c} are integers.
Let {u, v, w} be three numbers such that {u + v + w, u*X + v*Y + w*Z, u*X^2 + v*Y^2 + w*Z^2} are integers.
Then {p(n) = u*X^n + v*Y^n + w*Z^n | n = 0, 1, 2, ...} is an integer sequence with the recurrence relation: p(n) = -a*p(n-1) - b*p(n-2) - c*p(n-3).
Let k = Pi/7.
This sequence has (a, b, c) = (2, -1, -1), (u, v, w) = (2*cos(4k), 2*cos(8k), 2*cos(2k)).
A033304, A274975: (a, b, c) = (2, -1, -1), (u, v, w) = (2*cos(2k), 2*cos(4k), 2*cos(8k)).
A321174 : (a, b, c) = (2, -1, -1), (u, v, w) = (2*cos(8k), 2*cos(2k), 2*cos(4k)).
X = sin(2k)/sin(4k), Y = sin(4k)/sin(8k), Z = sin(8k)/sin(2k).

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{-2,1,1},{-1,3,-9},50] (* Stefano Spezia, Jan 11 2019 *)
  • PARI
    Vec(-(1 - x + 2*x^2) / (1 + 2*x - x^2 - x^3) + O(x^30)) \\ Colin Barker, Jan 11 2019

Formula

G.f.: -(1 - x + 2*x^2) / (1 + 2*x - x^2 - x^3). - Colin Barker, Jan 11 2019

A321703 a(n) = 3*a(n-1) + 4*a(n-2) + a(n-3), a(0) = 1, a(1) = 1, a(2) = 5.

Original entry on oeis.org

1, 1, 5, 20, 81, 328, 1328, 5377, 21771, 88149, 356908, 1445091, 5851054, 23690434, 95920609, 388374617, 1572496721, 6366909240, 25779089221, 104377401344, 422615470156, 1711135105065, 6928244597163, 28051889681905, 113579782539432, 459875150943079, 1861996472668870, 7539069804318358, 30525070454573633, 123593487053663201, 500419812783602493
Offset: 0

Author

Kai Wang, Jan 14 2019

Keywords

Comments

In general, let {X,Y,Z} be the roots of the cubic equation x^3 + ax^2 + xt + c = 0 where {a, b, c} are integers.
Let {u, v, w} be three numbers such that {u + v + w, u*X + v*Y + w*Z, u*X^2 + v*Y^2 + w*Z^2} are integers.
Then {p(n) = u*X^n + v*Y^n + w*Z^n | n = 0, 1, 2, ...} is an integer sequence with the recurrence relation: p(n) = -a*p(n-1) - b*p(n-2) - c*p(n-3).
Let k = Pi/7.
Let X = (sin(4k)*sin(8k))/(sin(2k)*sin(2k)),
Y = (sin(8k)*sin(2k))/(sin(4k)*sin(4k)),
Z = (sin(2k)*sin(4k))/(sin(8k)*sin(8k)).
Then {X,Y,Z} are the roots of the cubic equation x^3 - 3*x^2 - 4*x - 1 = 0.
This sequence: (a, b, c) = (3, 4, 1), (u, v, w) = (1/(sqrt(7)*tan(4k)), 1/(sqrt(7)*tan(8k)), 1/(sqrt(7)*tan(2k))).
A122600: (a, b, c) = (3, 4, 1), (u, v, w) = (1/(sqrt(7)*tan(2k)), 1/(sqrt(7)*tan(4k)), 1/(sqrt(7)*tan(8k))).
A321715: (a, b, c) = (3, 4, 1), (u, v, w) = (1/(sqrt(7)*tan(8k)), 1/(sqrt(7)*tan(2k)), 1/(sqrt(7)*tan(4k))).

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(-1 + 2 x + 2 x^2)/(-1 + 3 x + 4 x^2 + x^3), {x, 0, 50}], x] (* Stefano Spezia, Jan 14 2019 *)
  • PARI
    Vec((1 - 2*x - 2*x^2) / (1 - 3*x - 4*x^2 - x^3) + O(x^30)) \\ Colin Barker, Jan 15 2019

Formula

G.f.: (-1 + 2*x + 2*x^2)/(-1 + 3*x + 4*x^2 + x^3). - Stefano Spezia, Jan 14 2019

A321715 a(n) = 3*a(n-1) + 4*a(n-2) + a(n-3), a(0) = 1, a(1) = -1, a(2) = -1 .

Original entry on oeis.org

1, -1, -1, -6, -23, -94, -380, -1539, -6231, -25229, -102150, -413597, -1674620, -6780398, -27453271, -111156025, -450061557, -1822262042, -7378188379, -29873674862, -120956040144, -489741008259, -1982920860215, -8028682653825, -32507472410594, -131620068707297, -532918778418092, -2157744082494058, -8736527429861839, -35373477397979841, -143224285995880937
Offset: 0

Author

Kai Wang, Jan 14 2019

Keywords

Comments

In general, let {X,Y,Z} be the roots of the cubic equation x^3 + ax^2 + xt + c = 0 where {a, b, c} are integers.
Let {u, v, w} be three numbers such that {u + v + w, u*X + v*Y + w*Z, u*X^2 + v*Y^2 + w*Z^2} are integers.
Then {p(n) = u*X^n + v*Y^n + w*Z^n | n = 0, 1, 2, ...} is an integer sequence with the recurrence relation: p(n) = -a*p(n-1) - b*p(n-2) - c*p(n-3).
Let k = Pi/7.
Let X = (sin(4k)*sin(8k))/(sin(2k)*sin(2k)),
Y = (sin(8k)*sin(2k))/(sin(4k)*sin(4k)),
Z = (sin(2k)*sin(4k))/(sin(8k)*sin(8k)).
Then {X,Y,Z} are the roots of the cubic equation x^3 - 3*x^2 - 4*x - 1 = 0.
This sequence: (a, b, c) = (3, 4, 1), (u, v, w) = (1/(sqrt(7)*tan(8k)), 1/(sqrt(7)*tan(2k)), 1/(sqrt(7)*tan(4k))).
A122600: (a, b, c) = (3, 4, 1), (u, v, w) = (1/(sqrt(7)*tan(2k)), 1/(sqrt(7)*tan(4k)), 1/(sqrt(7)*tan(8k))).
A321703: (a, b, c) = (3, 4, 1), (u, v, w) = (1/(sqrt(7)*tan(4k)), 1/(sqrt(7)*tan(8k)), 1/(sqrt(7)*tan(2k))).

Crossrefs

Programs

  • PARI
    Vec((1 - 4*x - 2*x^2) / (1 - 3*x - 4*x^2 - x^3) + O(x^30)) \\ Colin Barker, Jan 15 2019

Formula

G.f.: (1 - 4*x - 2*x^2) / (1 - 3*x - 4*x^2 - x^3). - Colin Barker, Jan 15 2019

A321461 a(n) = -a(n-1) + 2*a(n-2) + a(n-3), a(0) = -1, a(1) = -2, a(2) = -4.

Original entry on oeis.org

-1, -2, -4, -1, -9, 3, -22, 19, -60, 76, -177, 269, -547, 908, -1733, 3002, -5560, 9831, -17949, 32051, -58118, 104271, -188456, 338880, -611521, 1100825, -1984987, 3575116, -6444265, 11609510, -20922924
Offset: 0

Author

Kai Wang, Jan 10 2019

Keywords

Comments

Let {X,Y,Z} be the roots of the cubic equation t^3 + at^2 + bt + c = 0 where {a, b, c} are integers.
Let {u, v, w} be three numbers such that {u + v + w, u*X + v*Y + w*Z, u*X^2 + v*Y^2 + w*Z^2} are integers.
Then {p(n) = u*X^n + v*Y^n + w*Z^n | n = 0, 1, 2, ...} is an integer sequence with the recurrence relation: p(n) = -a*p(n-1) - b*p(n-2) - c*p(n-3).
Let k = Pi/7.
This sequence has (a, b, c) = (1, -2, -1), (u, v, w) = (2*cos(4k), 2*cos(8k), 2*cos(2k)).
A094648: (a, b, c) = (1, -2, -1), (u, v, w) = (2*cos(8k), 2*cos(2k), 2*cos(4k)).
A321175: (a, b, c) = (1, -2, -1), (u, v, w) = (2*cos(2k), 2*cos(4k), 2*cos(8k)).
X = sin(2k)/sin(8k), Y = sin(4k)/sin(2k), Z = sin(8k)/sin(4k).

Crossrefs

Programs

  • PARI
    Vec(-(1 + 3*x + 4*x^2) / (1 + x - 2*x^2 - x^3) + O(x^40)) \\ Colin Barker, Feb 19 2019

Formula

G.f.: -(1 + 3*x + 4*x^2) / (1 + x - 2*x^2 - x^3). - Colin Barker, Feb 19 2019

Extensions

Title corrected by Colin Barker, Jan 12 2019

A322461 Sum of n-th powers of the roots of x^3 + 8*x^2 + 5*x - 1.

Original entry on oeis.org

3, -8, 54, -389, 2834, -20673, 150825, -1100401, 8028410, -58574450, 427353149, -3117924532, 22748056061, -165967472679, 1210881576595, -8834467193304, 64455362190778, -470259679983109, 3430966161717678, -25031975531635101, 182630713764509309
Offset: 0

Author

Kai Wang, Dec 09 2018

Keywords

Comments

Let A = cos(2*Pi/7), B = cos(4*Pi/7), C = cos(8*Pi/7).
For integers h, k let
X = 2*sqrt(7)*A^(h+k+1)/(B^h*C^k),
Y = 2*sqrt(7)*B^(h+k+1)/(C^h*A^k),
Z = 2*sqrt(7)*C^(h+k+1)/(A^h*B^k).
then X, Y, Z are the roots of a monic equation
t^3 + a*t^2 + b*t + c = 0
where a, b, c are integers and c = 1 or -1.
Then X^n + Y^n + Z^n, n = 0, 1, 2, ... is an integer sequence.
This sequence has (h,k) = (0,1).

Crossrefs

Similar sequences with (h,k) values: A094648 (0,0), A274075 (1,0).

Programs

  • Mathematica
    LinearRecurrence[{-8, -5, 1}, {3, -8, 54}, 50] (* Amiram Eldar, Dec 09 2018 *)
  • PARI
    Vec((3 + x)*(1 + 5*x) / (1 + 8*x + 5*x^2 - x^3) + O(x^25)) \\ Colin Barker, Dec 09 2018
    
  • PARI
    polsym(x^3 + 8*x^2 + 5*x - 1, 25) \\ Joerg Arndt, Dec 17 2018

Formula

a(n) = (2*sqrt(7)*A^2/C)^n + (2*sqrt(7)*B^2/A)^n + (2*sqrt(7)*C^2/B)^n, where A = cos(2*Pi/7), B = cos(4*Pi/7), C = cos(8*Pi/7).
a(n) = -8*a(n-2) - 5*a(n-2) + a(n-3) for n > 2.
G.f.: (3 + x)*(1 + 5*x) / (1 + 8*x + 5*x^2 - x^3). - Colin Barker, Dec 09 2018

A319512 a(n) = 7*a(n-1) - 14*a(n-2) + 7*a(n-3), a(0) = 1, a(1) = 3, a(2) = 11.

Original entry on oeis.org

1, 3, 11, 42, 161, 616, 2352, 8967, 34153, 129997, 494606, 1881355, 7154980, 27208132, 103456689, 393367835, 1495638123, 5686513994, 21620239081, 82199944512, 312521862408, 1188195487255, 4517461948657, 17175149855885, 65298950120782, 248262786503683
Offset: 0

Author

Kai Wang, Dec 10 2018

Keywords

Comments

Let {X,Y,Z} be the roots of the cubic equation
t^3 + at^2 + bt + c = 0
where {a, b, c} are integers. Let {u, v, w} be three numbers such that {u + v + w, u*X + v*Y + w*Z, u*X^2 + v*Y^2 + w*Z^2} are integers. Then
{p(n) = u*X^n + v*Y^n + w*Z^n | n = 0, 1, 2, ...}
is an integer sequence with the recurrence relation:
p(n) = -a*p(n-1) - b*p(n-2) - c*p(n-3).
This sequence has (a, b, c) = (-7, 14, -7), (u, v, w) = (1/(sqrt(7)*tan(4*(Pi/7))), 1/(sqrt(7)*tan(8*(Pi/7))), 1/(sqrt(7)*tan(2*(Pi/7)))).

Programs

  • Mathematica
    LinearRecurrence[{7, -14, 7}, {1, 3, 11}, 30] (* Amiram Eldar, Dec 10 2018 *)
    CoefficientList[Series[(1-2x)^2/(1-7x+14x^2-7x^3),{x,0,30}],x] (* Harvey P. Dale, Oct 08 2023 *)
  • PARI
    Vec((1 - 2*x)^2 / (1 - 7*x + 14*x^2 - 7*x^3) + O(x^40)) \\ Colin Barker, Dec 11 2018

Formula

(X, Y, Z) = (4*sin^2(2*(Pi/7)), 4*sin^2(4*(Pi/7)), 4*sin^2(8*(Pi/7)));
a(n) = 7*a(n-1) - 14*a(n-2) + 7*a(n-3), a(0) = 1, a(1) = 3, a(2) = 11.
G.f.: (1 - 2*x)^2 / (1 - 7*x + 14*x^2 - 7*x^3). - Colin Barker, Dec 11 2018

Extensions

More terms from Felix Fröhlich, Dec 10 2018

A322459 Sum of n-th powers of the roots of x^3 + 7*x^2 + 14*x + 7.

Original entry on oeis.org

3, -7, 21, -70, 245, -882, 3234, -12005, 44933, -169099, 638666, -2417807, 9167018, -34790490, 132119827, -501941055, 1907443237, -7249766678, 27557748813, -104759610858, 398257159370, -1514069805269, 5756205681709, -21884262613787, 83201447389466, -316323894905207
Offset: 0

Author

Kai Wang, Dec 09 2018

Keywords

Comments

Let A = sin(2*Pi/7), B = sin(4*Pi/7), C = sin(8*Pi/7).
In general, for integer h, k let
X = sqrt(7)*A^(h+k-1)/(2*B^h*C^k),
Y = sqrt(7)*B^(h+k-1)/(2*C^h*A^k),
Z = sqrt(7)*C^(h+k-1)/(2*A^h*B^k),
then X, Y, Z are the roots of a monic equation
t^3 + a*t^2 + b*t + c = 0
where a, b, c are integers and c = 1 or -1.
Then X^n + Y^n + Z^n , n = 0, 1, 2, ... is an integer sequence.
This sequence has (h,k) = (1,1).

Crossrefs

Similar sequences with (h,k) values: A275831 (0,0), A215575 (0,2).

Programs

  • Mathematica
    LinearRecurrence[{-7, -14, -7},{3, -7, 21}, 50] (* Amiram Eldar, Dec 09 2018 *)
    CoefficientList[Series[(3+14*x+14*x^2)/(1+7*x+14*x^2+7*x^3), {x, 0, 25}], x] (* G. C. Greubel, Dec 16 2018 *)
  • PARI
    Vec((3 + 14*x + 14*x^2) / (1 + 7*x + 14*x^2 + 7*x^3) + O(x^40)) \\ Colin Barker, Dec 09 2018
    
  • PARI
    polsym(x^3 + 7*x^2 + 14*x + 7, 25) \\ Joerg Arndt, Dec 17 2018

Formula

a(n) = (sqrt(7))^n*( (A/(2*B*C))^n + (B/(2*C*A))^n + (C/(2*A*B))^n ).
a(n) = -7*a(n-1) - 14*a(n-2) - 7*a(n-3) for n>2.
G.f.: (3 + 14*x + 14*x^2) / (1 + 7*x + 14*x^2 + 7*x^3). - Colin Barker, Dec 09 2018