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

A175654 Eight bishops and one elephant on a 3 X 3 chessboard. G.f.: (1 - x - x^2)/(1 - 3*x - x^2 + 6*x^3).

Original entry on oeis.org

1, 2, 6, 14, 36, 86, 210, 500, 1194, 2822, 6660, 15638, 36642, 85604, 199626, 464630, 1079892, 2506550, 5811762, 13462484, 31159914, 72071654, 166599972, 384912086, 888906306, 2052031172, 4735527306, 10925175254, 25198866036, 58108609526, 133973643090
Offset: 0

Views

Author

Johannes W. Meijer, Aug 06 2010; edited Jun 21 2013

Keywords

Comments

a(n) represents the number of n-move routes of a fairy chess piece starting in a given corner square (m = 1, 3, 7 or 9) on a 3 X 3 chessboard. This fairy chess piece behaves like a bishop on the eight side and corner squares but on the center square the bishop flies into a rage and turns into a raging elephant.
In chaturanga, the old Indian version of chess, one of the pieces was called gaja, elephant in Sanskrit. The Arabs called the game shatranj and the elephant became el fil in Arabic. In Spain chess became chess as we know it today but surprisingly in Spanish a bishop isn't a Christian bishop but a Moorish elephant and it still goes by its original name of el alfil.
On a 3 X 3 chessboard there are 2^9 = 512 ways for an elephant to fly into a rage on the central square (off the center the piece behaves like a normal bishop). The elephant is represented by the A[5] vector in the fifth row of the adjacency matrix A, see the Maple program and A180140. For the corner squares the 512 elephants lead to 46 different elephant sequences, see the overview of elephant sequences and the crossreferences.
The sequence above corresponds to 16 A[5] vectors with decimal values 71, 77, 101, 197, 263, 269, 293, 323, 326, 329, 332, 353, 356, 389, 449 and 452. These vectors lead for the side squares to A000079 and for the central square to A175655.

References

  • Gary Chartrand, Introductory Graph Theory, pp. 217-221, 1984.
  • David Hooper and Kenneth Whyld, The Oxford Companion to Chess, pp. 74, 366, 1992.

Crossrefs

Cf. Elephant sequences corner squares [decimal value A[5]]: A040000 [0], A000027 [16], A000045 [1], A094373 [2], A000079 [3], A083329 [42], A027934 [11], A172481 [7], A006138 [69], A000325 [26], A045623 [19], A000129 [21], A095121 [170], A074878 [43], A059570 [15], A175654 [71, this sequence], A026597 [325], A097813 [58], A057711 [27], 2*A094723 [23; n>=-1], A002605 [85], A175660 [171], A123203 [186], A066373 [59], A015518 [341], A134401 [187], A093833 [343].

Programs

  • Magma
    [n le 3 select Factorial(n) else 3*Self(n-1) +Self(n-2) -6*Self(n-3): n in [1..41]]; // G. C. Greubel, Dec 08 2021
    
  • Maple
    nmax:=28; m:=1; A[1]:=[0,0,0,0,1,0,0,0,1]: A[2]:=[0,0,0,1,0,1,0,0,0]: A[3]:=[0,0,0,0,1,0,1,0,0]: A[4]:=[0,1,0,0,0,0,0,1,0]: A[5]:=[0,0,1,0,0,0,1,1,1]: A[6]:=[0,1,0,0,0,0,0,1,0]: A[7]:=[0,0,1,0,1,0,0,0,0]: A[8]:=[0,0,0,1,0,1,0,0,0]: A[9]:=[1,0,0,0,1,0,0,0,0]: A:=Matrix([A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[8], A[9]]): for n from 0 to nmax do B(n):=A^n: a(n):= add(B(n)[m,k],k=1..9): od: seq(a(n), n=0..nmax);
  • Mathematica
    LinearRecurrence[{3,1,-6}, {1,2,6}, 80] (* Vladimir Joseph Stephan Orlovsky, Feb 21 2012 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; -6,1,3]^n*[1;2;6])[1,1] \\ Charles R Greathouse IV, Oct 03 2016
    
  • Sage
    [( (1-x-x^2)/((1-2*x)*(1-x-3*x^2)) ).series(x,n+1).list()[n] for n in (0..40)] # G. C. Greubel, Dec 08 2021

Formula

G.f.: (1 - x - x^2)/(1 - 3*x - x^2 + 6*x^3).
a(n) = 3*a(n-1) + a(n-2) - 6*a(n-3) with a(0)=1, a(1)=2 and a(2)=6.
a(n) = ((6+10*A)*A^(-n-1) + (6+10*B)*B^(-n-1))/13 - 2^n with A = (-1+sqrt(13))/6 and B = (-1-sqrt(13))/6.
Limit_{k->oo} a(n+k)/a(k) = (-1)^(n)*2*A000244(n)/(A075118(n) - A006130(n-1)*sqrt(13)).
a(n) = b(n) - b(n-1) - b(n-2), where b(n) = Sum_{k=1..n} Sum_{j=0..k} binomial(j,n-3*k+2*j)*(-6)^(k-j)*binomial(k,j)*3^(3*k-n-j), n>0, b(0)=1, with a(0) = b(0), a(1) = b(1) - b(0). - Vladimir Kruchinin, Aug 20 2010
a(n) = 2*A006138(n) - 2^n = 2*(A006130(n) + A006130(n-1)) - 2^n. - G. C. Greubel, Dec 08 2021
E.g.f.: 2*exp(x/2)*(13*cosh(sqrt(13)*x/2) + 3*sqrt(13)*sinh(sqrt(13)*x/2))/13 - cosh(2*x) - sinh(2*x). - Stefano Spezia, Feb 12 2023

A074829 Triangle formed by Pascal's rule, except that the n-th row begins and ends with the n-th Fibonacci number.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 4, 4, 3, 5, 7, 8, 7, 5, 8, 12, 15, 15, 12, 8, 13, 20, 27, 30, 27, 20, 13, 21, 33, 47, 57, 57, 47, 33, 21, 34, 54, 80, 104, 114, 104, 80, 54, 34, 55, 88, 134, 184, 218, 218, 184, 134, 88, 55, 89, 143, 222, 318, 402, 436, 402, 318, 222, 143, 89
Offset: 1

Views

Author

Joseph L. Pe, Sep 30 2002

Keywords

Examples

			The first and second Fibonacci numbers are 1, 1, so the first and second rows of the triangle are 1; 1 1; respectively. The third row of the triangle begins and ends with the third Fibonacci number, 2 and the middle term is the sum of the contiguous two terms in the second row, i.e., 1 + 1 = 2, so the third row is 2 2 2.
Triangle begins:
   1;
   1,  1;
   2,  2,  2;
   3,  4,  4,   3;
   5,  7,  8,   7,   5;
   8, 12, 15,  15,  12,   8;
  13, 20, 27,  30,  27,  20, 13;
  21, 33, 47,  57,  57,  47, 33, 21;
  34, 54, 80, 104, 114, 104, 80, 54, 34;
  ...
Formatted as a symmetric triangle:
                           1;
                        1,    1;
                     2,    2,    2;
                  3,    4,    4,    3;
               5,    7,    8,    7,    5;
            8,   12,   15,   15,   12,    8;
        13,   20,   27,   30,   27,   20,   13;
     21,   33,   47,   57,   57,   47,   33,   21;
  34,   54,   80,  104,  114,  104,   80,   54,   34;
		

Crossrefs

Some other Fibonacci-Pascal triangles: A027926, A036355, A037027, A105809, A108617, A109906, A111006, A114197, A162741, A228074.
Cf. A074878 (row sums).

Programs

  • GAP
    T:= function(n,k)
        if k=1 then return Fibonacci(n);
        elif k=n then return Fibonacci(n);
        else return T(n-1,k-1) + T(n-1,k);
        fi;
      end;
    Flat(List([1..15], n-> List([1..n], k-> T(n,k) ))); # G. C. Greubel, Jul 12 2019
  • Haskell
    a074829 n k = a074829_tabl !! (n-1) !! (k-1)
    a074829_row n = a074829_tabl !! (n-1)
    a074829_tabl = map fst $ iterate
       (\(u:_, vs) -> (vs, zipWith (+) ([u] ++ vs) (vs ++ [u]))) ([1], [1,1])
    -- Reinhard Zumkeller, Aug 15 2013
    
  • Maple
    A074829 := proc(n,k)
        option remember ;
        if k=1 or k=n then
            combinat[fibonacci](n) ;
        else
            procname(n-1,k-1)+procname(n-1,k) ;
        end if;
    end proc:
    seq(seq(A074829(n,k),k=1..n),n=1..12) ; # R. J. Mathar, Mar 31 2025
  • Mathematica
    T[n_, 1]:= Fibonacci[n]; T[n_, n_]:= Fibonacci[n]; T[n_, k_]:= T[n-1, k-1] + T[n-1, k]; Table[T[n, k], {n, 1, 12}, {k, 1, n}]//Flatten (* G. C. Greubel, Jul 12 2019 *)
  • PARI
    T(n,k) = if(k==1 || k==n, fibonacci(n), T(n-1,k-1) + T(n-1,k));
    for(n=1,12, for(k=1,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Jul 12 2019
    
  • Sage
    def T(n, k):
        if (k==1 or k==n): return fibonacci(n)
        else: return T(n-1, k-1) + T(n-1, k)
    [[T(n, k) for k in (1..n)] for n in (1..12)] # G. C. Greubel, Jul 12 2019
    

Extensions

More terms from Philippe Deléham, Sep 20 2006
Data error in 7th row fixed by Reinhard Zumkeller, Aug 15 2013

A011794 Triangle defined by T(n+1, k) = T(n, k-1) + T(n-1, k), T(n,1) = 1, T(1,k) = 1, T(2,k) = min(2,k).

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 1, 3, 4, 5, 1, 3, 6, 7, 8, 1, 4, 7, 11, 12, 13, 1, 4, 10, 14, 19, 20, 21, 1, 5, 11, 21, 26, 32, 33, 34, 1, 5, 15, 25, 40, 46, 53, 54, 55, 1, 6, 16, 36, 51, 72, 79, 87, 88, 89, 1, 6, 21, 41, 76, 97, 125, 133, 142, 143, 144, 1, 7, 22, 57, 92, 148, 176, 212, 221, 231, 232, 233
Offset: 1

Views

Author

Keywords

Examples

			matrix(10,10,n,k,a(n-1,k-1))
  [ 0 0 0 0 0 0 0 0 0 0 ]
  [ 0 1 1 1 1 1 1 1 1 1 ]
  [ 0 1 2 2 2 2 2 2 2 2 ]
  [ 0 1 2 3 3 3 3 3 3 3 ]
  [ 0 1 3 4 5 5 5 5 5 5 ]
  [ 0 1 3 6 7 8 8 8 8 8 ]
Triangle begins as:
  1;
  1, 2;
  1, 2,  3;
  1, 3,  4,  5;
  1, 3,  6,  7,  8;
  1, 4,  7, 11, 12, 13;
  1, 4, 10, 14, 19, 20, 21;
  1, 5, 11, 21, 26, 32, 33, 34;
  1, 5, 15, 25, 40, 46, 53, 54, 55;
  1, 6, 16, 36, 51, 72, 79, 87, 88, 89;
		

Crossrefs

Columns include A008619 and (essentially) A055802, A055803, A055804, A055805, A055806.
Essentially a reflected version of A055801.
Sums include: A039834 (signed row), A131913 (row).

Programs

  • Magma
    function T(n,k) // T = A011794(n,k)
      if k eq 1 or n eq 1 then return 1;
      elif n eq 2 then return Min(2, k);
      else return T(n-1,k-1) + T(n-2,k);
      end if;
    end function;
    [T(n,k): k in [1..n], n in [1..15]]; // G. C. Greubel, Oct 21 2024
    
  • Mathematica
    T[n_, k_]:= T[n, k]= T[n-1, k-1] + T[n-2, k]; T[n_, 1] = 1; T[1, k_] = 1; T[2, k_] := Min[2, k]; Table[T[n, k], {n,15}, {k,n}]//Flatten (* Jean-François Alcover, Feb 26 2013 *)
  • PARI
    T(n,k)=if(n<=0 || k<=0,0, if(n<=2 || k==1, min(n,k), T(n-1,k-1)+T(n-2,k)))
    
  • SageMath
    def T(n, k): # T = A011794
        if (k==1 or n==1): return 1
        elif (n==2): return min(2,k)
        else: return T(n-1, k-1) + T(n-2, k)
    flatten([[T(n, k) for k in range(1,n+1)] for n in range(1,16)]) # G. C. Greubel, Oct 21 2024

Formula

T(n,n) = Fibonacci(n+1). - Jean-François Alcover, Feb 26 2013
From G. C. Greubel, Oct 21 2024: (Start)
Sum_{k=1..n} T(n, k) = A131913(n-1).
Sum_{k=1..n} (-1)^(k-1)*T(n, k) = A039834(n).
Sum_{k=1..floor((n+1)/2)} T(n-k+1,k) = (1/2)*((1-(-1)^n)*A074878((n+3)/2) + (1+(-1)^n)*A008466((n+6)/2)) (diagonal row sums).
Sum_{k=1..floor((n+1)/2)} (-1)^(k-1)*T(n-k+1,k) = (-1)^floor((n-1)/2)*A103609(n) + [n=1] (signed diagonal row sums). (End)

Extensions

Entry improved by comments from Michael Somos
More terms added by G. C. Greubel, Oct 21 2024

A175657 Eight bishops and one elephant on a 3 X 3 chessboard: a(n) = 3*2^n - 2*F(n+1), with F(n) = A000045(n).

Original entry on oeis.org

1, 4, 8, 18, 38, 80, 166, 342, 700, 1426, 2894, 5856, 11822, 23822, 47932, 96330, 193414, 388048, 778070, 1559334, 3123836, 6256034, 12525598, 25073088, 50181598, 100420510, 200933756, 402017562, 804277910, 1608948656, 3218532934
Offset: 0

Views

Author

Johannes W. Meijer, Aug 06 2010

Keywords

Comments

The a(n) represent the number of n-move routes of a fairy chess piece starting in the central square (m = 5) on a 3 X 3 chessboard. This fairy chess piece behaves like a bishop on the eight side and corner squares but on the central square the bishop turns into a raging elephant, see A175654.
The sequence above corresponds to 16 A[5] vectors with decimal values 43, 46, 106, 139, 142, 163, 166, 169, 172, 202, 226, 232, 298, 394, 418 and 424. These vectors lead for the side squares to A000079 and for the corner squares to A074878 (a(n)=3*2^n-2*F(n+2)).

Crossrefs

Cf. A000045, A000079, A074878, A175654, A175655 (central square).

Programs

  • Magma
    I:=[1,4,8]; [n le 3 select I[n] else 3*Self(n-1)-Self(n-2)-2*Self(n-3): n in [1..35]]; // Vincenzo Librandi, Jul 21 2013
  • Maple
    with(LinearAlgebra): nmax:=30; m:=5; A[5]:= [0,0,0,1,0,1,0,1,1]: A:=Matrix([[0,0,0,0,1,0,0,0,1], [0,0,0,1,0,1,0,0,0], [0,0,0,0,1,0,1,0,0], [0,1,0,0,0,0,0,1,0], A[5], [0,1,0,0,0,0,0,1,0], [0,0,1,0,1,0,0,0,0], [0,0,0,1,0,1,0,0,0], [1,0,0,0,1,0,0,0,0]]): for n from 0 to nmax do B(n):=A^n: a(n):= add(B(n)[m,k],k=1..9): od: seq(a(n), n=0..nmax);
  • Mathematica
    LinearRecurrence[{3,-1,-2},{1,4,8},40] (* Harvey P. Dale, Aug 12 2012 *)
    CoefficientList[Series[(1 + x - 3 x^2) / (1 - 3 x + x^2 + 2 x^3), {x, 0, 40}], x] (* Vincenzo Librandi, Jul 21 2013 *)

Formula

G.f.: (1+x-3*x^2)/(1-3*x+x^2+2*x^3).
a(n) = 3*a(n-1)-a(n-2)-2*a(n-3) with a(0)=1, a(1)=4 and a(2)=8.

A175660 Eight bishops and one elephant on a 3 X 3 chessboard. a(n) = 2^(n+2) - 3*F(n+2).

Original entry on oeis.org

1, 2, 7, 17, 40, 89, 193, 410, 859, 1781, 3664, 7493, 15253, 30938, 62575, 126281, 254392, 511745, 1028281, 2064314, 4141171, 8302637, 16638112, 33329357, 66744685, 133628474, 267482023, 535328225, 1071245704, 2143444841
Offset: 0

Views

Author

Johannes W. Meijer, Aug 06 2010, Aug 10 2010

Keywords

Comments

The a(n) represent the number of n-move routes of a fairy chess piece starting in a given corner square (m = 1, 3, 7, 9) on a 3 X 3 chessboard. This fairy chess piece behaves like a bishop on the eight side and corner squares but on the central square the bishop turns into a raging elephant, see A175654.
The sequence above corresponds to four A[5] vectors with decimal values 171, 174, 234 and 426. These vectors lead for the side squares to A000079 and for the central square to A175661 (a(n) = 2^(n+2) - 3*F(n+1)).

Crossrefs

Cf. A008466 (2^n-F(n+2)), A027934 (2^n-F(n+1)), A027974 (2^(n+3)-F(n+5)-F(n+3)), A074878 (3*2^n-2*F(n+2)), A142585 ((-1)^(n+1)*(2^(n-1)-F(n+1)-F(n-1))), A175661 (2^(n+2)-3*F(n+1)), A179610 (convolution of (-4)^n and F(n+1)).

Programs

  • Maple
    nmax:=29; m:=1; A[5]:= [0,1,0,1,0,1,0,1,1]: A:=Matrix([[0,0,0,0,1,0,0,0,1], [0,0,0,1,0,1,0,0,0], [0,0,0,0,1,0,1,0,0], [0,1,0,0,0,0,0,1,0], A[5], [0,1,0,0,0,0,0,1,0], [0,0,1,0,1,0,0,0,0], [0,0,0,1,0,1,0,0,0], [1,0,0,0,1,0,0,0,0]]): for n from 0 to nmax do B(n):=A^n: a(n):= add(B(n)[m,k],k=1..9): od: seq(a(n), n=0..nmax);
  • Mathematica
    Table[2^(n+2)-3Fibonacci[n+2],{n,0,30}] (* or *) LinearRecurrence[ {3,-1,-2},{1,2,7},30] (* Harvey P. Dale, Dec 28 2012 *)

Formula

G.f.: (1 - x + 2*x^2)/(1 - 3*x + x^2 + 2*x^3).
a(n) = 3*a(n-1) - a(n-2) - 2*a(n-3) with a(0)=1, a(1)=2 and a(2)=7.
a(n) = 2^(n+2) - 3*F(n+2) with F(n)=A000045(n).

A131239 Triangle, T(n,k) = 3*A007318(n,k) - 2*A046854(n,k), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 5, 7, 1, 1, 8, 12, 10, 1, 1, 9, 24, 22, 13, 1, 1, 12, 33, 52, 35, 16, 1, 1, 13, 51, 85, 95, 51, 19, 1, 1, 16, 64, 148, 180, 156, 70, 22, 1, 1, 17, 88, 212, 348, 336, 238, 92, 25, 1, 1, 20, 105, 320, 560, 714, 574, 344, 117, 28, 1, 1, 21, 135, 425, 920, 1274, 1330, 918, 477, 145, 31, 1
Offset: 0

Views

Author

Gary W. Adamson, Jun 21 2007

Keywords

Comments

Row sums = A074878: (1, 2, 6, 14, 32, 70, 239, ...).

Examples

			First few rows of the triangle:
  1;
  1,  1;
  1,  4,  1;
  1,  5,  7,  1;
  1,  8, 12, 10,  1;
  1,  9, 24, 22, 13,  1;
  1, 12, 33, 52, 35, 16, 1;
  ...
		

Crossrefs

Programs

  • GAP
    B:=Binomial;; Flat(List([0..12], n-> List([0..n], k-> 3*B(n,k) - 2*B(Int((n+k)/2), k) ))); # G. C. Greubel, Jul 12 2019
  • Magma
    B:=Binomial; [3*B(n,k) - 2*B(Floor((n+k)/2), k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jul 12 2019
    
  • Mathematica
    With[{B=Binomial}, Table[3*B[n,k] - 2*B[Floor[(n+k)/2], k], {n,0,12}, {k,0,n}]]//Flatten (* G. C. Greubel, Jul 12 2019 *)
  • PARI
    b=binomial; T(n,k) = 3*b(n,k) - 2*b((n+k)\2, k);
    for(n=0,12, for(k=0,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Jul 12 2019
    
  • Sage
    b=binomial; [[3*b(n,k) - 2*b(floor((n+k)/2), k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Jul 12 2019
    

Formula

T(n,k) = 3*A007318(n,k) - 2*A046854(n,k) as infinite lower triangular matrices.
T(n,k) = 3*binomial(n,k) - 2*binomial(floor((n+k)/2), k). - G. C. Greubel, Jul 12 2019

Extensions

More terms added by G. C. Greubel, Jul 12 2019

A131399 3*A007318 - A046854 - A065941.

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 6, 6, 1, 1, 9, 12, 9, 1, 1, 11, 23, 23, 11, 1, 1, 14, 34, 52, 34, 14, 1, 1, 16, 51, 90, 90, 51, 16, 1, 1, 19, 67, 152, 180, 152, 67, 19, 1, 1, 21, 90, 225, 342, 342, 225, 90, 21, 1
Offset: 0

Views

Author

Gary W. Adamson, Jul 05 2007

Keywords

Comments

Row sums = A074878: (1, 2, 6, 14, 32, 70, 150,...).

Examples

			First few rows of the triangle are:
1;
1, 1;
1, 4, 1;
1, 6, 6, 1;
1, 9, 12, 9, 1;
1, 11, 23, 23, 11, 1;
1, 14, 34, 52, 34, 14, 1;
1, 16, 51, 90, 90, 51, 16, 1;
...
		

Crossrefs

Formula

3*A007318 - A046854 - A065941 as infinite lower triangular matrices.
Showing 1-7 of 7 results.