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-10 of 20 results. Next

A128099 Triangle read by rows: T(n,k) is the number of ways to tile a 3 X n rectangle with k pieces of 2 X 2 tiles and 3n-4k pieces of 1 X 1 tiles (0 <= k <= floor(n/2)).

Original entry on oeis.org

1, 1, 1, 2, 1, 4, 1, 6, 4, 1, 8, 12, 1, 10, 24, 8, 1, 12, 40, 32, 1, 14, 60, 80, 16, 1, 16, 84, 160, 80, 1, 18, 112, 280, 240, 32, 1, 20, 144, 448, 560, 192, 1, 22, 180, 672, 1120, 672, 64, 1, 24, 220, 960, 2016, 1792, 448, 1, 26, 264, 1320, 3360, 4032, 1792, 128, 1, 28
Offset: 0

Views

Author

Emeric Deutsch, Feb 18 2007

Keywords

Comments

Row sums are the Jacobsthal numbers (A001045).
Apparently, T(n,k)/2^n equals the probability P that n will occur as a partial sum in a randomly-generated infinite sequence of 1s and 2s with n compositions (ordered partitions) into (n-2k) 1s and k 2s. Example: T(6,2)=24; P = 3/8 (24/2^6) that 6 will occur as a partial sum in the sequence with 2 (6-2*2) 1s and 2 2s. - Bob Selcoe, Jul 06 2013
From Johannes W. Meijer, Aug 28 2013: (Start)
The antidiagonal sums are A077949 and the backwards antidiagonal sums are A052947.
Moving the terms in each column of this triangle, see the example, upwards to row 0 gives the Pell-Jacobsthal triangle A013609 as a square array. (End)
The numbers in rows of the triangle are along "first layer" skew diagonals pointing top-right in center-justified triangle given in A013609 ((1+2*x)^n) and along (first layer) skew diagonals pointing top-left in center-justified triangle given in A038207 ((2+x)^n), see links. - Zagros Lalo, Jul 31 2018
If s(n) is the row sum at n, then the ratio s(n)/s(n-1) is approximately 2.000..., when n approaches infinity. - Zagros Lalo, Jul 31 2018
It appears that the rows of this array are the coefficients of the Jacobsthal polynomials (see MathWorld link). - Michel Marcus, Jun 15 2019

Examples

			Triangle starts:
  1;
  1;
  1,  2;
  1,  4;
  1,  6,  4;
  1,  8, 12;
  1, 10, 24,  8;
  1, 12, 40, 32;
		

References

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

Crossrefs

Cf. (Triangle sums) A001045, A095977, A077949, A052947, A113726, A052942, A077909.
Cf. (Similar triangles) A008315, A011973, A102541.

Programs

  • Maple
    T := proc(n,k) if k<=n/2 then 2^k*binomial(n-k,k) else 0 fi end: for n from 0 to 16 do seq(T(n,k),k=0..floor(n/2)) od; # yields sequence in triangular form
    T := proc(n, k) option remember: if k<0 or k > floor(n/2) then return(0) fi: if k = 0 then return(1) fi: 2*procname(n-2, k-1) + procname(n-1, k): end: seq(seq(T(n, k), k=0..floor(n/2)), n=0..13); # Johannes W. Meijer, Aug 28 2013
  • Mathematica
    Table[2^k*Binomial[n - k, k] , {n,0,25}, {k,0,Floor[n/2]}] // Flatten  (* G. C. Greubel, Dec 28 2016 *)
    t[0, 0] = 1; t[n_, k_] := t[n, k] = If[n < 0 || k < 0, 0, t[n - 1, k] + 2 t[n - 2, k - 1]]; Table[t[n, k], {n, 0, 15}, {k, 0, Floor[n/2]}] // Flatten (* Zagros Lalo, Jul 31 2018 *)

Formula

T(n, k) = 2^k*binomial(n-k,k) = 2^k*A011973(n,k).
G.f.: 1/(1-z-2*t*z^2).
Sum_{k=0..floor(n/2)} k*T(n,k) = A095977(n-1).
From Johannes W. Meijer, Aug 28 2013: (Start)
T(n, k) = 2*T(n-2, k-1) + T(n-1, k) with T(n, 0) = 1 and T(n, k) = 0 for k < 0 and k > floor(n/2).
T(n, k) = A013609(n-k, k), n >= 0 and 0 <= k <= floor(n/2). (End)

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

Original entry on oeis.org

1, 1, 2, 3, 4, 7, 10, 15, 24, 35, 54, 83, 124, 191, 290, 439, 672, 1019, 1550, 2363, 3588, 5463, 8314, 12639, 19240, 29267, 44518, 67747, 103052, 156783, 238546, 362887, 552112, 839979, 1277886, 1944203, 2957844, 4499975, 6846250, 10415663
Offset: 0

Views

Author

Creighton Dement, Apr 08 2009

Keywords

Comments

A floretion-generated sequence: 'i + 0.5('ij' + 'ik' + 'ji' + 'jk' + 'ki' + 'kj')
Starting with offset 1 the sequence appears to be the INVERT transform of (1, 1, 0, -1, 1, 0, -1, 1, 0, -1, 1, 0, ...). - Gary W. Adamson, Aug 27 2016

Crossrefs

Programs

  • Magma
    I:=[1, 1, 2]; [n le 3 select I[n] else Self(n-2) + 2*Self(n-2): n in [1..30]]; // G. C. Greubel, Jun 27 2018
  • Mathematica
    CoefficientList[Series[(1+x+x^2)/(1-x^2-2x^3),{x,0,50}],x]  (* Harvey P. Dale, Mar 09 2011 *)
    LinearRecurrence[{0, 1, 2}, {1, 1, 2}, 50] (* G. C. Greubel, Jun 27 2018 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; 2,1,0]^n*[1;1;2])[1,1] \\ Charles R Greathouse IV, Aug 27 2016
    
  • PARI
    Vec((1 + x + x^2) / (1 - x^2 - 2*x^3) + O(x^40)) \\ Colin Barker, Apr 29 2019
    

Formula

a(n) = A159287(n) + A159287(n+1) + A159287(n+2). - R. J. Mathar, Apr 10 2009
a(n) = a(n-2) + 2*a(n-3) for n>2. - Colin Barker, Apr 29 2019
a(n)= A052947(n) + A052947(n-1) +A052947(n-2). - R. J. Mathar, Mar 23 2023

A183111 Magnetic Tower of Hanoi, number of moves of disk number k, optimally solving the [RED ; BLUE ; NEUTRAL] or [NEUTRAL ; RED ; BLUE] pre-colored puzzle.

Original entry on oeis.org

0, 1, 3, 9, 25, 75, 223, 665, 1993, 5971, 17903, 53697, 161065, 483163, 1449439, 4348233, 13044585, 39133571, 117400431, 352200881, 1056601993, 3169805003, 9509413535, 28528238329, 85584711561, 256754129459, 770262380399, 2310787129121, 6932361368937
Offset: 0

Views

Author

Uri Levy, Dec 25 2010

Keywords

Comments

A. The Magnetic Tower of Hanoi puzzle is described in link 1 listed below. The Magnetic Tower is pre-colored. Pre-coloring is [RED ; BLUE ; NEUTRAL] or [NEUTRAL ; RED ; BLUE], given in [Source ; Intermediate ; Destination] order. The solution algorithm producing the sequence is optimal (the sequence presented gives the minimum number of moves to solve the puzzle for the given pre-coloring configurations). Optimal solutions are discussed and their optimality is proved in link 2 listed below.
B. Disk numbering is from largest disk (k = 1) to smallest disk (k = N)
C. The above-listed "original" sequence generates a "partial-sums" sequence - describing the total number of moves required to solve the puzzle.
D. The number of moves of disk k, for large k, is close to (10/11)*3^(k-1) ~ 0.909*3^(k-1). Series designation: P909(k).

Crossrefs

A000244 "Powers of 3" is the sequence (also) describing the number of moves of the k-th disk solving [RED ; BLUE ; BLUE] or [RED ; RED ; BLUE] pre-colored Magnetic Tower of Hanoi.

Programs

  • Mathematica
    LinearRecurrence[{3,1,-1,-6},{0,1,3,9,25},30] (* Harvey P. Dale, Apr 30 2018 *)

Formula

G.f.: -x*(-1+4*x^3+x^2) / ( (3*x-1)*(2*x^3+x^2-1) ).
Recurrence Relations (a(n)=P909(n) as in referenced paper):
a(n) = a(n-2) + a(n-3) + 2*3^(n-2) + 2*3^(n-4) ; n >= 4
Closed-Form Expression:
Define:
λ1 = [1+sqrt(26/27)]^(1/3) + [1-sqrt(26/27)]^(1/3)
λ2 = -0.5* λ1 + 0.5*i*{[sqrt(27)+sqrt(26)]^(1/3)- [sqrt(27)-sqrt(26)]^(1/3)}
λ3 = -0.5* λ1 - 0.5*i*{[sqrt(27)+sqrt(26)]^(1/3)- [sqrt(27)-sqrt(26)]^(1/3)}
AP = [(1/11)* λ2* λ3 - (3/11)*(λ2 + λ3) + (9/11)]/[( λ2 - λ1)*( λ3 - λ1)]
BP = [(1/11)* λ1* λ3 - (3/11)*(λ1 + λ3) + (9/11)]/[( λ1 - λ2)*( λ3 - λ2)]
CP = [(1/11)* λ1* λ2 - (3/11)*(λ1 + λ2) + (9/11)]/[( λ2 - λ3)*( λ1 - λ3)]
For any n > 0:
a(n) = (10/11)*3^(n-1) + AP* λ1^(n-1) + BP* λ2^(n-1) + CP* λ3^(n-1)
33*a(n) = 10*3^n -3*( A052947(n-2) -A052947(n-1) -4*A052947(n) ). - R. J. Mathar, Feb 05 2020

Extensions

More terms from Harvey P. Dale, Apr 30 2018

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

Original entry on oeis.org

0, 1, 1, 1, 3, 3, 5, 9, 11, 19, 29, 41, 67, 99, 149, 233, 347, 531, 813, 1225, 1875, 2851, 4325, 6601, 10027, 15251, 23229, 35305, 53731, 81763, 124341, 189225, 287867, 437907, 666317, 1013641, 1542131, 2346275, 3569413, 5430537
Offset: 0

Views

Author

Creighton Dement, Apr 08 2009

Keywords

Comments

a(n) is the number of composition of n+1 into parts congruent to 0 or 2 modulo 3. - Joerg Arndt, Apr 21 2025

Crossrefs

Programs

  • Magma
    I:=[0,1,1]; [n le 3 select I[n] else Self(n-2) + 2*Self(n-3): n in [1..30]]; // G. C. Greubel, Jun 27 2018
  • Mathematica
    CoefficientList[Series[x (1+x)/(1-x^2-2x^3),{x,0,50}],x] (* or *) LinearRecurrence[ {0,1,2},{0,1,1},50] (* Harvey P. Dale, Jul 16 2013 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; 2,1,0]^n*[0;1;1])[1,1] \\ Charles R Greathouse IV, Oct 03 2016
    

Formula

a(n) = abs(A078028(n-1)). - R. J. Mathar, Jul 05 2012
a(n) = a(n-2) + 2*a(n-3), a(0)=0, a(1) = a(2) =1. - G. C. Greubel, Apr 30 2017
a(n) = A052947(n-1)+A052947(n-2). - R. J. Mathar, Mar 23 2023

Extensions

Deleted certain dangerous or potentially dangerous links. - N. J. A. Sloane, Jan 30 2021

A219946 Number A(n,k) of tilings of a k X n rectangle using right trominoes and 2 X 2 tiles; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 2, 2, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 4, 4, 4, 4, 0, 1, 1, 0, 5, 0, 6, 0, 5, 0, 1, 1, 0, 6, 8, 16, 16, 8, 6, 0, 1, 1, 0, 13, 0, 37, 0, 37, 0, 13, 0, 1, 1, 0, 16, 16, 92, 136, 136, 92, 16, 16, 0, 1, 1, 0, 25, 0, 245, 0, 545, 0, 245, 0, 25, 0, 1
Offset: 0

Views

Author

Alois P. Heinz, Dec 01 2012

Keywords

Examples

			A(4,4) = 6, because there are 6 tilings of a 4 X 4 rectangle using right trominoes and 2 X 2 tiles:
  .___.___. .___.___. .___.___. .___.___. .___.___. .___.___.
  | . | . | | ._|_. | | ._| . | | ._|_. | | ._|_. | | . |_. |
  |___|___| |_| . |_| |_| |___| |_| ._|_| |_|_. |_| |___| |_|
  | . | . | | |___| | | |___| | | |_| . | | . |_| | | |___| |
  |___|___| |___|___| |___|___| |___|___| |___|___| |___|___|
Square array A(n,k) begins:
  1,  1,  1,  1,   1,    1,     1,      1,       1,        1, ...
  1,  0,  0,  0,   0,    0,     0,      0,       0,        0, ...
  1,  0,  1,  2,   1,    4,     5,      6,      13,       16, ...
  1,  0,  2,  0,   4,    0,     8,      0,      16,        0, ...
  1,  0,  1,  4,   6,   16,    37,     92,     245,      560, ...
  1,  0,  4,  0,  16,    0,   136,      0,    1128,      384, ...
  1,  0,  5,  8,  37,  136,   545,   2376,   10534,    46824, ...
  1,  0,  6,  0,  92,    0,  2376,   5504,   71248,   253952, ...
  1,  0, 13, 16, 245, 1128, 10534,  71248,  652036,  5141408, ...
  1,  0, 16,  0, 560,  384, 46824, 253952, 5141408, 44013568, ...
		

Crossrefs

Columns (or rows) k=0-10 give: A000012, A000007, A052947, A077957, A165799, A190759, A219947, A219948, A219949, A219950, A219951.
Main diagonal gives: A219952.

Programs

  • Maple
    b:= proc(n, l) option remember; local k, t;
          if max(l[])>n then 0 elif n=0 or l=[] then 1
        elif min(l[])>0 then t:=min(l[]); b(n-t, map(h->h-t, l))
        else for k do if l[k]=0 then break fi od;
             `if`(k>1 and l[k-1]=1, b(n, subsop(k=2, k-1=2, l)), 0)+
             `if`(k `if`(n>=k, b(n, [0$k]), b(k, [0$n])):
    seq(seq(A(n, d-n), n=0..d), d=0..14);
  • Mathematica
    b[n_, l_] := b[n, l] = Module[{k, t}, If[Max[l] > n , 0 , If [n == 0 || l == {},1 , If[Min[l] > 0, t = Min[l]; b[n-t, l-t], For[k = 1, k <= Length[l], k++, If[l[[k]] == 0 , Break[]]]; If[k > 1 && l[[k-1]] == 1, b[n, ReplacePart[l, {k -> 2, k-1 -> 2}]], 0] + If[k < Length[l] && l[[k+1]] == 1, b[n, ReplacePart[l, {k -> 2, k+1 -> 2}]], 0] + If[k < Length[l] && l[[k+1]] == 0, b[n, ReplacePart[l, {k -> 2, k+1 -> 2}]] + b[n, ReplacePart[l, {k -> 1, k+1 -> 2}]] + b[n, ReplacePart[l, {k -> 2, k+1 -> 1}]], 0]+If[k+1 < Length[l] && l[[k+1]] == 0 && l[[k+2]] == 0, b[n, ReplacePart[l, {k -> 2, k+1 -> 2, k+2 -> 2}]], 0]]]]]; a[n_, ] := If[n >= k, b[n, Array[0&, k]], b[k, Array[0&, n]]]; Table[Table[a[n, d-n], {n, 0, d}], {d, 0, 14}] // Flatten (* _Jean-François Alcover, Nov 26 2013, translated from Alois P. Heinz's Maple program *)

A110509 Riordan array (1, x(1-2x)).

Original entry on oeis.org

1, 0, 1, 0, -2, 1, 0, 0, -4, 1, 0, 0, 4, -6, 1, 0, 0, 0, 12, -8, 1, 0, 0, 0, -8, 24, -10, 1, 0, 0, 0, 0, -32, 40, -12, 1, 0, 0, 0, 0, 16, -80, 60, -14, 1, 0, 0, 0, 0, 0, 80, -160, 84, -16, 1, 0, 0, 0, 0, 0, -32, 240, -280, 112, -18, 1, 0, 0, 0, 0, 0, 0, -192, 560, -448, 144, -20, 1, 0, 0, 0, 0, 0, 0, 64, -672, 1120, -672, 180, -22, 1
Offset: 0

Views

Author

Paul Barry, Jul 24 2005

Keywords

Comments

Inverse is Riordan array (1,xc(2x)) [A110510]. Row sums are A107920(n+1). Diagonal sums are (-1)^n*A052947(n).

Examples

			Rows begin
1;
0,  1;
0, -2,  1;
0,  0, -4,  1;
0,  0,  4, -6,  1;
0,  0,  0, 12, -8,   1;
0,  0,  0, -8, 24, -10, 1;
		

Programs

  • Mathematica
    T[n_, k_] := (-2)^(n - k)*Binomial[k, n - k]; Table[T[n, k], {n, 0, 49}, {k, 0, n}] // Flatten (* G. C. Greubel, Aug 29 2017 *)
  • PARI
    for(n=0,25, for(k=0,n, print1((-2)^(n-k)*binomial(k, n-k), ", "))) \\ G. C. Greubel, Aug 29 2017

Formula

Number triangle: T(n, k) = (-2)^(n-k)*binomial(k, n-k).
T(n,k) = A109466(n,k)*2^(n-k). - Philippe Deléham, Oct 26 2008

A159287 Expansion of x^2/(1-x^2-2*x^3).

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 1, 4, 5, 6, 13, 16, 25, 42, 57, 92, 141, 206, 325, 488, 737, 1138, 1713, 2612, 3989, 6038, 9213, 14016, 21289, 32442, 49321, 75020, 114205, 173662, 264245, 402072, 611569, 930562, 1415713, 2153700, 3276837, 4985126, 7584237, 11538800
Offset: 0

Views

Author

Creighton Dement, Apr 08 2009

Keywords

Comments

A floretion-generated sequence: 'i + 0.5('ij' + 'ik' + 'ji' + 'jk' + 'ki' + 'kj').
From Greg Dresden, Nov 15 2024: (Start)
a(n) is the number of ways to tile a 2 X (n+1) board with L-shaped trominos and S-shaped quadrominos, where the first tile must be an upright L. For example, here are the a(7)=4 ways to tile a 2 X 8 board:
| | | | | | | | | | | |
|_|_||__|___| |_|___|||___|
| | | | | | | | | | | |
|_|_|_|___|| |__|___||__|_| (End)

Crossrefs

Essentially the same as A052947.

Programs

Formula

G.f.: x^2/(1-x^2-2*x^3).
a(n) = A052947(n-2). - R. J. Mathar, Nov 10 2009
a(n) = a(n-2) + 2*a(n-3). - Wesley Ivan Hurt, May 23 2023
From Greg Dresden, Nov 17 2024: (Start)
a(2*n+1) = 2*a(n)^2 + 2*a(n+1)*a(n+2).
a(3*n+1) = Sum_{i=1..n} a(3*i-2)*2^(n-i). (End)

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

Original entry on oeis.org

1, 2, 2, 4, 5, 6, 12, 16, 25, 42, 58, 92, 141, 206, 324, 488, 737, 1138, 1714, 2612, 3989, 6038, 9212, 14016, 21289, 32442, 49322, 75020, 114205, 173662, 264244, 402072, 611569, 930562, 1415714, 2153700, 3276837, 4985126, 7584236, 11538800
Offset: 0

Views

Author

Creighton Dement, May 25 2005

Keywords

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(1 + x)^2 / ((1 - x^2 - 2*x^3)*(1 + x^4)),{x,0,39}],x] (* James C. McMahon, Feb 19 2024 *)
  • PARI
    Vec((1 + x)^2 / ((1 - x^2 - 2*x^3)*(1 + x^4)) + O(x^45)) \\ Colin Barker, Apr 30 2019

Formula

a(n) = A052947(n+2) + A014017(n+6). - Ralf Stephan, Nov 30 2010
a(n) = a(n-2) + 2*a(n-3) - a(n-4) + a(n-6) + 2*a(n-7) for n>6. - Colin Barker, Apr 30 2019

A107850 Expansion of g.f. (x^2+x+1)*(2*x^2+2*x+1)*(x-1)^2/((1-x^2-2*x^3)*(x^4+1)).

Original entry on oeis.org

1, 1, 1, 0, 1, 1, 3, 6, 7, 13, 17, 24, 41, 57, 91, 142, 207, 325, 489, 736, 1137, 1713, 2611, 3990, 6039, 9213, 14017, 21288, 32441, 49321, 75019, 114206, 173663, 264245, 402073, 611568, 930561, 1415713, 2153699, 3276838, 4985127, 7584237, 11538801
Offset: 0

Views

Author

Creighton Dement, May 25 2005

Keywords

Comments

Floretion Algebra Multiplication Program, FAMP Code: 1lesforzapseq[(.5i' + .5j' + .5'ki' + .5'kj')*(.5'i + .5'j + .5'ik' + .5'jk')], 1vesforzap = A000004

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(x^2+x+1)(2x^2+2x+1)(x-1)^2/((1-x^2-2x^3)(x^4+1)),{x,0,50}],x] (* or *) LinearRecurrence[{0,1,2,-1,0,1,2},{1,1,1,0,1,1,3},50] (* Harvey P. Dale, Dec 26 2015 *)

Formula

a(n) = A052947(n-1)+A118831(n+6). - R. J. Mathar, Apr 18 2008
a(0)=1, a(1)=1, a(2)=1, a(3)=0, a(4)=1, a(5)=1, a(6)=3, a(n)=a(n-2)+ 2*a(n-3)- a(n-4)+a(n-6)+2*a(n-7). - Harvey P. Dale, Dec 26 2015

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

Original entry on oeis.org

1, 3, 1, 5, 7, 7, 17, 21, 31, 55, 73, 117, 183, 263, 417, 629, 943, 1463, 2201, 3349, 5127, 7751, 11825, 18005, 27327, 41655, 63337, 96309, 146647, 222983, 339265, 516277, 785231, 1194807, 1817785, 2765269, 4207399, 6400839, 9737937, 14815637
Offset: 0

Views

Author

Creighton Dement, Apr 08 2009

Keywords

Comments

A floretion-generated sequence: 'i + 0.5('ij' + 'ik' + 'ji' + 'jk' + 'ki' + 'kj')

Crossrefs

Programs

  • Magma
    I:=[1,3,1]; [n le 3 select I[n] else Self(n-2) + 2*Self(n-3): n in [1..30]]; // G. C. Greubel, Jun 27 2018
  • Mathematica
    LinearRecurrence[{0, 1, 2}, {1, 3, 1}, 50] (* G. C. Greubel, Jun 27 2018 *)
    CoefficientList[Series[(1+3x)/(1-x^2-2x^3),{x,0,40}],x] (* Harvey P. Dale, Jan 21 2019 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; 2,1,0]^n*[1;3;1])[1,1] \\ Charles R Greathouse IV, Oct 03 2016
    

Formula

a(n) = A052947(n) + 3*A052947(n-1). - R. J. Mathar, Mar 23 2023
Showing 1-10 of 20 results. Next