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: Zagros Lalo

Zagros Lalo's wiki page.

Zagros Lalo has authored 29 sequences. Here are the ten most recent ones:

A318777 Coefficients in expansion of 1/(1 - x - 2*x^5).

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 5, 7, 9, 11, 17, 27, 41, 59, 81, 115, 169, 251, 369, 531, 761, 1099, 1601, 2339, 3401, 4923, 7121, 10323, 15001, 21803, 31649, 45891, 66537, 96539, 140145, 203443, 295225, 428299, 621377, 901667, 1308553, 1899003, 2755601, 3998355, 5801689, 8418795
Offset: 0

Author

Zagros Lalo, Sep 25 2018

Keywords

Comments

The coefficients in the expansion of 1/(1 - x - 2*x^5) are given by the sequence generated by the row sums in triangle A318775.
Coefficients in expansion of 1/(1 - x - 2*x^5) are given by the sum of numbers along "fourth Layer" skew diagonals pointing top-right in triangle A013609 ((1+2x)^n) and by the sum of numbers along "fourth Layer" skew diagonals pointing top-left in triangle A038207 ((2+x)^n), see links.

References

  • Shara Lalo and Zagros Lalo, Polynomial Expansion Theorems and Number Triangles, Zana Publishing, 2018, ISBN: 978-1-9995914-0-3.

Crossrefs

Essentially a duplicate of A143447.

Programs

  • GAP
    a:=[1,1,1,1,1,3];; for n in [7..50] do a[n]:=a[n-1]+2*a[n-5]; od; a; # Muniru A Asiru, Sep 26 2018
  • Maple
    seq(coeff(series((1-x-2*x^5)^(-1),x,n+1), x, n), n = 0 .. 50); # Muniru A Asiru, Sep 26 2018
  • Mathematica
    a[0] = 1; a[n_] := a[n] = If[n < 0, 0, a[n - 1] + 2 * a[n - 5]];Table[a[n], {n, 0, 45}] // Flatten
    LinearRecurrence[{1, 0, 0, 0, 2}, {1, 1, 1, 1, 1}, 46]
    CoefficientList[Series[1/(1 - x - 2 x^5), {x, 0, 45}], x]

Formula

a(0)=1, a(n) = a(n-1) + 2 * a(n-5) for n = 0,1...; a(n)=0 for n < 0.
G.f.: -1/(2*x^5 + x - 1). - Chai Wah Wu, Aug 03 2020

A318776 Triangle read by rows: T(0,0) = 1; T(n,k) = 2*T(n-1,k) + T(n-5,k-1) for k = 0..floor(n/5); T(n,k)=0 for n or k < 0.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 1, 64, 4, 128, 12, 256, 32, 512, 80, 1024, 192, 1, 2048, 448, 6, 4096, 1024, 24, 8192, 2304, 80, 16384, 5120, 240, 32768, 11264, 672, 1, 65536, 24576, 1792, 8, 131072, 53248, 4608, 40, 262144, 114688, 11520, 160, 524288, 245760, 28160, 560, 1048576, 524288, 67584, 1792, 1, 2097152, 1114112, 159744, 5376, 10
Offset: 0

Author

Zagros Lalo, Sep 04 2018

Keywords

Comments

The numbers in rows of the triangle are along a "fourth layer" skew diagonals pointing top-left in center-justified triangle given in A013609 ((1+2*x)^n) and along a "fourth layer" skew diagonals pointing top-right in center-justified triangle given in A038207 ((2+x)^n), see links. (Note: First layer skew diagonals in center-justified triangles of coefficients in expansions of (1+2*x)^n and (2+x)^n are given in A128099 and A207538 respectively.)
The coefficients in the expansion of 1/(1-2*x-x^5) are given by the sequence generated by the row sums.
The row sums give A098588.
If s(n) is the row sum at n, then the ratio s(n)/s(n-1) is approximately 2.0559673967128..., when n approaches infinity.

Examples

			Triangle begins:
        1;
        2;
        4;
        8;
       16;
       32,       1;
       64,       4;
      128,      12;
      256,      32;
      512,      80;
     1024,     192,      1;
     2048,     448,      6;
     4096,    1024,     24;
     8192,    2304,     80;
    16384,    5120,    240;
    32768,   11264,    672,    1;
    65536,   24576,   1792,    8;
   131072,   53248,   4608,   40;
   262144,  114688,  11520,  160;
   524288,  245760,  28160,  560;
  1048576,  524288,  67584, 1792,  1;
  2097152, 1114112, 159744, 5376, 10;
  ...
		

References

  • Shara Lalo and Zagros Lalo, Polynomial Expansion Theorems and Number Triangles, Zana Publishing, 2018, ISBN: 978-1-9995914-0-3.

Crossrefs

Row sums give A098588.
Cf. also A000079 (column 0), A001787 (column 1), A001788 (column 2), A001789 (column 3)

Programs

  • Mathematica
    t[n_, k_] := t[n, k] = 2^(n - 5 k)/((n - 5 k)! k!) (n - 4 k)!; Table[t[n, k], {n, 0, 21}, {k, 0, Floor[n/5]} ] // Flatten
    t[0, 0] = 1; t[n_, k_] := t[n, k] = If[n < 0 || k < 0, 0, 2 t[n - 1, k] + t[n - 5, k - 1]]; Table[t[n, k], {n, 0, 21}, {k, 0, Floor[n/5]}] // Flatten

Formula

T(n,k) = 2^(n - 5*k) / ((n - 5*k)! k!) * (n - 4*k)! where n >= 0 and 0 <= k <= floor(n/5).

A318775 Triangle read by rows: T(0,0) = 1; T(n,k) = T(n-1,k) + 2 * T(n-5,k-1) for k = 0..floor(n/5); T(n,k)=0 for n or k < 0.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 4, 1, 6, 1, 8, 1, 10, 1, 12, 4, 1, 14, 12, 1, 16, 24, 1, 18, 40, 1, 20, 60, 1, 22, 84, 8, 1, 24, 112, 32, 1, 26, 144, 80, 1, 28, 180, 160, 1, 30, 220, 280, 1, 32, 264, 448, 16, 1, 34, 312, 672, 80, 1, 36, 364, 960, 240, 1, 38, 420, 1320, 560, 1, 40, 480, 1760, 1120
Offset: 0

Author

Zagros Lalo, Sep 04 2018

Keywords

Comments

The numbers in rows of the triangle are along a "fourth layer" skew diagonals pointing top-right in center-justified triangle given in A013609 ((1+2*x)^n) and along a "fourth layer" skew diagonals pointing top-left in center-justified triangle given in A038207 ((2+x)^n), see links. (Note: First layer skew diagonals in center-justified triangles of coefficients in expansions of (1+2*x)^n and (2+x)^n are given in A128099 and A207538 respectively.)
The coefficients in the expansion of 1/(1-x-2*x^5) are given by the sequence generated by the row sums.
The row sums give A318777.
If s(n) is the row sum at n, then the ratio s(n)/s(n-1) is approximately 1.4510850920547191..., when n approaches infinity.

Examples

			Triangle begins:
  1;
  1;
  1;
  1;
  1;
  1,  2;
  1,  4;
  1,  6;
  1,  8;
  1, 10;
  1, 12,   4;
  1, 14,  12;
  1, 16,  24;
  1, 18,  40;
  1, 20,  60;
  1, 22,  84,    8;
  1, 24, 112,   32;
  1, 26, 144,   80;
  1, 28, 180,  160;
  1, 30, 220,  280;
  1, 32, 264,  448,  16;
  1, 34, 312,  672,  80;
  1, 36, 364,  960, 240;
  1, 38, 420, 1320, 560;
  ...
		

References

  • Shara Lalo and Zagros Lalo, Polynomial Expansion Theorems and Number Triangles, Zana Publishing, 2018, ISBN: 978-1-9995914-0-3.

Crossrefs

Row sums give A318777.

Programs

  • Mathematica
    t[n_, k_] := t[n, k] = 2^k/((n - 5 k)! k!) (n - 4 k)!; Table[t[n, k], {n, 0, 24}, {k, 0, Floor[n/5]} ] // Flatten
    t[0, 0] = 1; t[n_, k_] := t[n, k] = If[n < 0 || k < 0, 0, t[n - 1, k] + 2 t[n - 5, k - 1]]; Table[t[n, k], {n, 0, 24}, {k, 0, Floor[n/5]}] // Flatten

Formula

T(n,k) = 2^k / ((n - 5*k)! k!) * (n - 4*k)! where n >= 0 and 0 <= k <= floor(n/5).

A318774 Coefficients in expansion of 1/(1 - x - 3*x^4).

Original entry on oeis.org

1, 1, 1, 1, 4, 7, 10, 13, 25, 46, 76, 115, 190, 328, 556, 901, 1471, 2455, 4123, 6826, 11239, 18604, 30973, 51451, 85168, 140980, 233899, 388252, 643756, 1066696, 1768393, 2933149, 4864417, 8064505, 13369684, 22169131, 36762382, 60955897, 101064949, 167572342, 277859488, 460727179, 763922026, 1266639052
Offset: 0

Author

Zagros Lalo, Sep 04 2018

Keywords

Comments

The coefficients in the expansion of 1/(1 - x - 3*x^4) are given by the sequence generated by the row sums in triangle A318772.
Coefficients in expansion of 1/(1 - x - 3*x^4) are given by the sum of numbers along "third Layer" skew diagonals pointing top-right in triangle A013610 ((1+3x)^n) and by the sum of numbers along "third Layer" skew diagonals pointing top-left in triangle A027465 ((3+x)^n), see links.

References

  • Shara Lalo and Zagros Lalo, Polynomial Expansion Theorems and Number Triangles, Zana Publishing, 2018, ISBN: 978-1-9995914-0-3.

Crossrefs

Essentially a duplicate of A143454.

Programs

  • Magma
    [n le 4 select 1 else Self(n-1) +3*Self(n-4): n in [1..51]]; // G. C. Greubel, May 08 2021
    
  • Mathematica
    CoefficientList[Series[1/(1-x-3x^4), {x, 0, 50}], x]
    a[n_]:= a[n]= If[n<4, 1, a[n-1] + 3*a[n-4]]; Table[a[n], {n,0,50}]
    LinearRecurrence[{1,0,0,3}, {1,1,1,1}, 51]
  • PARI
    my(p=Mod('x,x^4-'x^3-3)); a(n) = vecsum(Vec(lift(p^n))); \\ Kevin Ryde, May 11 2021
  • Sage
    def a(n): return 1 if (n<4) else a(n-1) + 3*a(n-4)
    [a(n) for n in (0..50)] # G. C. Greubel, May 08 2021
    

Formula

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

A318773 Triangle T(n,k) = 3*T(n-1,k) + T(n-4,k-1) for k = 0..floor(n/4), with T(0,0) = 1 and T(n,k) = 0 for n or k < 0, read by rows.

Original entry on oeis.org

1, 3, 9, 27, 81, 1, 243, 6, 729, 27, 2187, 108, 6561, 405, 1, 19683, 1458, 9, 59049, 5103, 54, 177147, 17496, 270, 531441, 59049, 1215, 1, 1594323, 196830, 5103, 12, 4782969, 649539, 20412, 90, 14348907, 2125764, 78732, 540, 43046721, 6908733, 295245, 2835, 1, 129140163, 22320522, 1082565, 13608, 15
Offset: 0

Author

Zagros Lalo, Sep 04 2018

Keywords

Comments

The numbers in rows of the triangle are along a "third layer" skew diagonals pointing top-left in center-justified triangle given in A013610 ((1+3*x)^n) and along a "third layer" skew diagonals pointing top-right in center-justified triangle given in A027465 ((3+x)^n), see links. (Note: First layer of skew diagonals in center-justified triangles of coefficients in expansions of (1+3*x)^n and (3+x)^n are given in A304236 and A304249 respectively.)
The coefficients in the expansion of 1/(1-3*x-x^4) are given by the sequence generated by the row sums.
If s(n) is the row sum at n, then the ratio s(n)/s(n-1) is approximately 3.035744112294..., when n approaches infinity.

Examples

			Triangle begins:
          1;
          3;
          9;
         27;
         81,        1;
        243,        6;
        729,       27;
       2187,      108;
       6561,      405,       1;
      19683,     1458,       9;
      59049,     5103,      54;
     177147,    17496,     270;
     531441,    59049,    1215,     1;
    1594323,   196830,    5103,    12;
    4782969,   649539,   20412,    90;
   14348907,  2125764,   78732,   540;
   43046721,  6908733,  295245,  2835,   1;
  129140163, 22320522, 1082565, 13608,  15;
  387420489, 71744535, 3897234, 61236, 135;
  ...
		

References

  • Shara Lalo and Zagros Lalo, Polynomial Expansion Theorems and Number Triangles, Zana Publishing, 2018, ISBN: 978-1-9995914-0-3.

Crossrefs

Row sums give A052917.
Cf. A000244 (column 0), A027471 (column 1), A027472 (column 2), A036216 (column 3).
Sequences of the form 3^(n-q*k)*binomial(n-(q-1)*k, k): A027465 (q=1), A304249 (q=2), A317497 (q=3), this sequence (q=4).

Programs

  • Magma
    [3^(n-4*k)*Binomial(n-3*k,k): k in [0..Floor(n/4)], n in [0..24]]; // G. C. Greubel, May 12 2021
    
  • Mathematica
    T[n_, k_]:= T[n, k] = 3^(n-4k)*(n-3k)!/((n-4k)! k!); Table[T[n, k], {n, 0, 17}, {k, 0, Floor[n/4]} ]//Flatten
    T[0, 0] = 1; T[n_, k_]:= T[n, k] = If[n<0 || k<0, 0, 3T[n-1, k] + T[n-4, k-1]]; Table[T[n, k], {n, 0, 17}, {k, 0, Floor[n/4]}]//Flatten
  • Sage
    flatten([[3^(n-4*k)*binomial(n-3*k,k) for k in (0..n//4)] for n in (0..24)]) # G. C. Greubel, May 12 2021

Formula

T(n,k) = 3^(n-4*k) * (n-3*k)!/(k! * (n-4*k)!) where n >= 0 and 0 <= k <= floor(n/4).

A318772 Triangle read by rows: T(0,0) = 1; T(n,k) = T(n-1,k) + 3 * T(n-4,k-1) for k = 0..floor(n/4); T(n,k)=0 for n or k < 0.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 1, 6, 1, 9, 1, 12, 1, 15, 9, 1, 18, 27, 1, 21, 54, 1, 24, 90, 1, 27, 135, 27, 1, 30, 189, 108, 1, 33, 252, 270, 1, 36, 324, 540, 1, 39, 405, 945, 81, 1, 42, 495, 1512, 405, 1, 45, 594, 2268, 1215, 1, 48, 702, 3240, 2835, 1, 51, 819, 4455, 5670, 243, 1, 54, 945, 5940, 10206, 1458
Offset: 0

Author

Zagros Lalo, Sep 04 2018

Keywords

Comments

The numbers in rows of the triangle are along a "third layer" skew diagonals pointing top-right in center-justified triangle given in A013610 ((1+3*x)^n) and along a "third layer" skew diagonals pointing top-left in center-justified triangle given in A027465 ((3+x)^n), see links. (Note: First layer of skew diagonals in center-justified triangles of coefficients in expansions of (1+3*x)^n and (3+x)^n are given in A304236 and A304249 respectively.)
The coefficients in the expansion of 1/(1-x-3*x^4) are given by the sequence generated by the row sums.
If s(n) is the row sum at n, then the ratio s(n)/s(n-1) is approximately 1.6580980673722..., when n approaches infinity.

Examples

			Triangle begins:
  1;
  1;
  1;
  1;
  1,  3;
  1,  6;
  1,  9;
  1, 12;
  1, 15,   9;
  1, 18,  27;
  1, 21,  54;
  1, 24,  90;
  1, 27, 135,   27;
  1, 30, 189,  108;
  1, 33, 252,  270;
  1, 36, 324,  540;
  1, 39, 405,  945,   81;
  1, 42, 495, 1512,  405;
  1, 45, 594, 2268, 1215;
  ...
		

References

  • Shara Lalo and Zagros Lalo, Polynomial Expansion Theorems and Number Triangles, Zana Publishing, 2018, ISBN: 978-1-9995914-0-3.

Crossrefs

Row sums give A318774.

Programs

  • Magma
    [3^k*Binomial(n-3*k,k): k in [0..Floor(n/4)], n in [0..24]]; // G. C. Greubel, May 12 2021
    
  • Mathematica
    T[n_, k_]:= T[n, k]= 3^k(n-3k)!/((n-4k)! k!); Table[T[n, k], {n, 0, 21}, {k, 0, Floor[n/4]} ] // Flatten
    T[0, 0] = 1; T[n_, k_] := T[n, k] = If[n<0 || k<0, 0, T[n-1, k] + 3T[n-4, k-1]]; Table[T[n, k], {n, 0, 21}, {k, 0, Floor[n/4]}] // Flatten
  • Sage
    flatten([[3^k*binomial(n-3*k,k) for k in (0..n//4)] for n in (0..24)]) # G. C. Greubel, May 12 2021

Formula

T(n,k) = 3^k * (n - 3*k)!/ ((n - 4*k)! k!), where n >= 0 and 0 <= k <= floor(n/4).

A317501 Triangle read by rows: T(0,0) = 1; T(n,k) = 2*T(n-1,k) + T(n-4,k-1) for k = 0..floor(n/4); T(n,k)=0 for n or k < 0.

Original entry on oeis.org

1, 2, 4, 8, 16, 1, 32, 4, 64, 12, 128, 32, 256, 80, 1, 512, 192, 6, 1024, 448, 24, 2048, 1024, 80, 4096, 2304, 240, 1, 8192, 5120, 672, 8, 16384, 11264, 1792, 40, 32768, 24576, 4608, 160, 65536, 53248, 11520, 560, 1, 131072, 114688, 28160, 1792, 10, 262144, 245760, 67584, 5376, 60
Offset: 0

Author

Zagros Lalo, Sep 03 2018

Keywords

Comments

Unsigned version of the triangle in A317506.
The numbers in rows of the triangle are along a "third layer" skew diagonals pointing top-left in center-justified triangle given in A013609 ((1+2*x)^n) and along a "third layer" skew diagonals pointing top-right in center-justified triangle given in A038207 ((2+x)^n), see links. (Note: First layer skew diagonals in center-justified triangles of coefficients in expansions of (1+2*x)^n and (2+x)^n are given in A128099 and A207538 respectively.)
The coefficients in the expansion of 1/(1-2*x-x^4) are given by the sequence generated by the row sums.
The row sums give A008999.
If s(n) is the row sum at n, then the ratio s(n)/s(n-1) is approximately 2.106919340376..., when n approaches infinity.

Examples

			Triangle begins:
       1;
       2;
       4;
       8;
      16,      1;
      32,      4;
      64,     12;
     128,     32;
     256,     80,     1;
     512,    192,     6;
    1024,    448,    24;
    2048,   1024,    80;
    4096,   2304,   240,    1;
    8192,   5120,   672,    8;
   16384,  11264,  1792,   40;
   32768,  24576,  4608,  160;
   65536,  53248, 11520,  560,  1;
  131072, 114688, 28160, 1792, 10;
  262144, 245760, 67584, 5376, 60;
		

References

  • Shara Lalo and Zagros Lalo, Polynomial Expansion Theorems and Number Triangles, Zana Publishing, 2018, ISBN: 978-1-9995914-0-3.

Crossrefs

Row sums give A008999.

Programs

  • Mathematica
    t[n_, k_] := t[n, k] = 2^(n - 4 k)/((n - 4 k)! k!) (n - 3 k)!; Table[t[n, k], {n, 0, 18}, {k, 0, Floor[n/4]} ] // Flatten
    t[0, 0] = 1; t[n_, k_] := t[n, k] = If[n < 0 || k < 0, 0, 2 t[n - 1, k] + t[n - 4, k - 1]]; Table[t[n, k], {n, 0, 18}, {k, 0, Floor[n/4]}] // Flatten

Formula

T(n,k) = 2^(n - 4*k) / ((n - 4*k)! k!) * (n - 3*k)! where n >= 0 and 0 <= k <= floor(n/4).

A317500 Triangle read by rows: T(0,0) = 1; T(n,k) = T(n-1,k) + 2 * T(n-4,k-1) for k = 0..floor(n/4); T(n,k)=0 for n or k < 0.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 4, 1, 6, 1, 8, 1, 10, 4, 1, 12, 12, 1, 14, 24, 1, 16, 40, 1, 18, 60, 8, 1, 20, 84, 32, 1, 22, 112, 80, 1, 24, 144, 160, 1, 26, 180, 280, 16, 1, 28, 220, 448, 80, 1, 30, 264, 672, 240, 1, 32, 312, 960, 560, 1, 34, 364, 1320, 1120, 32
Offset: 0

Author

Zagros Lalo, Sep 03 2018

Keywords

Comments

The numbers in rows of the triangle are along a "third layer" skew diagonals pointing top-right in center-justified triangle given in A013609 ((1+2*x)^n) and along a "third layer" skew diagonals pointing top-left in center-justified triangle given in A038207 ((2+x)^n), see links. (Note: First layer skew diagonals in center-justified triangles of coefficients in expansions of (1+2*x)^n and (2+x)^n are given in A128099 and A207538 respectively.)
The coefficients in the expansion of 1/(1-x-2*x^4) are given by the sequence generated by the row sums.
The row sums give A052942.
If s(n) is the row sum at n, then the ratio s(n)/s(n-1) is approximately 1.543689012692076... (A256099: Decimal expansion of the real root of a cubic used by Omar Khayyám in a geometrical problem), when n approaches infinity.

Examples

			Triangle begins:
  1;
  1;
  1;
  1;
  1,  2;
  1,  4;
  1,  6;
  1,  8;
  1, 10,   4;
  1, 12,  12;
  1, 14,  24;
  1, 16,  40;
  1, 18,  60,   8;
  1, 20,  84,  32;
  1, 22, 112,  80;
  1, 24, 144, 160;
  1, 26, 180, 280,  16;
  1, 28, 220, 448,  80;
  1, 30, 264, 672, 240;
...
		

References

  • Shara Lalo and Zagros Lalo, Polynomial Expansion Theorems and Number Triangles, Zana Publishing, 2018, ISBN: 978-1-9995914-0-3.

Crossrefs

Row sums give A052942.

Programs

  • Mathematica
    t[n_, k_] := t[n, k] = 2^k/((n - 4 k)! k!) (n - 3 k)!; Table[t[n, k], {n, 0, 20}, {k, 0, Floor[n/4]} ] // Flatten
    t[0, 0] = 1; t[n_, k_] := t[n, k] = If[n < 0 || k < 0, 0, t[n - 1, k] + 2 t[n - 4, k - 1]]; Table[t[n, k], {n, 0, 20}, {k, 0, Floor[n/4]}] // Flatten

Formula

T(n,k) = 2^k / ((n - 4*k)! k!) * (n - 3*k)! where n >= 0 and 0 <= k <= floor(n/4).

A317499 Coefficients in expansion of 1/(1 + 2*x - 3*x^3).

Original entry on oeis.org

1, -2, 4, -5, 4, 4, -23, 58, -104, 139, -104, -104, 625, -1562, 2812, -3749, 2812, 2812, -16871, 42178, -75920, 101227, -75920, -75920, 455521, -1138802, 2049844, -2733125, 2049844, 2049844, -12299063, 30747658, -55345784, 73794379, -55345784, -55345784
Offset: 0

Author

Zagros Lalo, Jul 31 2018

Keywords

Comments

The coefficients in the expansion of 1/(1 + 2*x - 3*x^3) are given by the sequence generated by the row sums in triangle A317503.
Coefficients in expansion of 1/(1 + 2*x - 3*x^3) are given by the sum of numbers along second Layer skew diagonals pointing top-left in triangle A303901 ((3-2*x)^n) and by the sum of numbers along second Layer skew diagonals pointing top-right in triangle A317498 ((-2+3*x)^n), see links.

References

  • Shara Lalo and Zagros Lalo, Polynomial Expansion Theorems and Number Triangles, Zana Publishing, 2018, ISBN: 978-1-9995914-0-3, pp. 396, 397.

Crossrefs

Programs

  • GAP
    a:=[1,-2,4];; for n in [4..40] do a[n]:=-2*a[n-1]+3*a[n-3]; od; a; # Muniru A Asiru, Aug 01 2018
    
  • Maple
    seq(coeff(series(1/(1+2*x-3*x^3), x,n+1),x,n),n=0..40); # Muniru A Asiru, Aug 01 2018
  • Mathematica
    CoefficientList[Series[1/(1 + 2 x - 3 x^3), {x, 0, 40}], x]
    a[0] = 1; a[n_] := a[n] = If[n < 0, 0, -2 * a[n - 1] + 3 * a[n - 3]]; Table[a[n], {n, 0, 40}] // Flatten
    LinearRecurrence[{-2, 0, 3}, {1, -2, 4}, 41]
  • PARI
    Vec(1 / ((1 - x)*(1 + 3*x + 3*x^2)) + O(x^40)) \\ Colin Barker, Aug 02 2018

Formula

a(0)=1, a(n) = -2*a(n-1) + 3*a(n-3) for n = 0,1...; a(n)=0 for n < 0.
a(n) = (2^(-n)*(2^n + (-3-i*sqrt(3))^n*(3-2*i*sqrt(3)) + (-3+i*sqrt(3))^n*(3+2*i*sqrt(3)))) / 7 where i=sqrt(-1). - Colin Barker, Aug 02 2018

A317498 Triangle read by rows of coefficients in expansions of (-2 + 3*x)^n, where n is nonnegative integer.

Original entry on oeis.org

1, -2, 3, 4, -12, 9, -8, 36, -54, 27, 16, -96, 216, -216, 81, -32, 240, -720, 1080, -810, 243, 64, -576, 2160, -4320, 4860, -2916, 729, -128, 1344, -6048, 15120, -22680, 20412, -10206, 2187, 256, -3072, 16128, -48384, 90720, -108864, 81648, -34992, 6561, -512, 6912, -41472, 145152, -326592, 489888, -489888, 314928, -118098, 19683
Offset: 0

Author

Zagros Lalo, Jul 31 2018

Keywords

Comments

Row n gives coefficients in expansion of (-2 + 3*x)^n.
This is a signed version of A013620.
The coefficients in the expansion of 1/(1-x) are given by the sequence generated by the row sums.
The row sums give A000012 (The simplest sequence of positive numbers: the all 1's sequence).
The numbers in rows of triangles in A302747 and A303941 (Triangle of coefficients of Fermat polynomials) are along first layer skew diagonals pointing top-right and top-left in center-justified triangle of coefficients in expansions of (-2 + 3*x)^n, see links.

Examples

			Triangle begins:
     1;
    -2,     3;
     4,   -12,      9;
    -8,    36,    -54,     27;
    16,   -96,    216,   -216,      81;
   -32,   240,   -720,   1080,    -810,     243;
    64,  -576,   2160,  -4320,    4860,   -2916,     729;
  -128,  1344,  -6048,  15120,  -22680,   20412,  -10206,   2187;
   256, -3072,  16128, -48384,   90720, -108864,   81648, -34992,    6561;
  -512,  6912, -41472, 145152, -326592,  489888, -489888, 314928, -118098, 19683;
  ...
		

References

  • Shara Lalo and Zagros Lalo, Polynomial Expansion Theorems and Number Triangles, Zana Publishing, 2018, ISBN: 978-1-9995914-0-3, Pages 394-396.

Crossrefs

Row sums give A000012.
Cf. A013620 ((2+3*x)^n).

Programs

  • GAP
    Flat(List([0..8],n->List([0..n],k->(-2)^(n-k)*3^k/(Factorial(n-k)*Factorial(k))*Factorial(n)))); # Muniru A Asiru, Aug 01 2018
  • Mathematica
    t[0, 0] = 1; t[n_, k_] := t[n, k] = If[n < 0 || k < 0, 0, -2 t[n - 1, k] + 3 t[n - 1, k - 1]]; Table[t[n, k], {n, 0, 9}, {k, 0, n}] // Flatten
    t[n_, k_] := t[n, k] = ((-2)^(n - k) 3^k)/((n - k)! k!) n!;Table[t[n, k], {n, 0, 9}, {k, 0, n} ] // Flatten
    Table[CoefficientList[(-2 + 3 x)^n, x], {n, 0, 9}] // Flatten
  • PARI
    trianglerows(n) = my(v=[]); for(k=0, n-1, v=Vec((-2+3*x)^k + O(x^(k+1))); print(v))
    /* Print initial 10 rows of triangle as follows */
    trianglerows(10) \\ Felix Fröhlich, Jul 31 2018
    

Formula

T(0,0) = 1; T(n,k) = -2 * T(n-1,k) + 3 * T(n-1,k-1) for k = 0,1,...,n and T(n,k)=0 for n or k < 0.
T(n, k) = ((-2)^(n - k) 3^k)/((n - k)! k!) n! for k = 0,1..n.
G.f.: 1 / (1 + 2*x - 3*x*t).