A180030 Number of n-move paths on a 3 X 3 chessboard of a queen starting or ending in a corner or side square.
1, 6, 38, 238, 1494, 9374, 58822, 369102, 2316086, 14533246, 91194918, 572240558, 3590762134, 22531735134, 141384772742, 887177744782, 5566966905846, 34932256487486, 219197017684198, 1375443140320878, 8630791843077974
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..200
- Index entries for linear recurrences with constant coefficients, signature (5, 8).
Programs
-
Magma
I:=[1,6]; [n le 2 select I[n] else 5*Self(n-1)+8*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Nov 15 2011
-
Maple
with(LinearAlgebra): nmax:=20; m:=1; A[5]:= [1,1,1,1,0,1,1,1,1]: A:=Matrix([[0,1,1,1,1,0,1,0,1], [1,0,1,1,1,1,0,1,0], [1,1,0,0,1,1,1,0,1], [1,1,0,0,1,1,1,1,0], A[5], [0,1,1,1,1,0,0,1,1], [1,0,1,1,1,0,0,1,1], [0,1,0,1,1,1,1,0,1], [1,0,1,0,1,1,1,1,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[{5,8},{1,6},201] (* Vincenzo Librandi, Nov 15 2011 *)
Formula
G.f.: (1+x)/(1 - 5*x - 8*x^2).
a(n) = 5*a(n-1) + 8*a(n-2) with a(0) = 1 and a(1) = 6.
a(n) = ((7+11*A)*A^(-n-1) + (7+11*B)*B^(-n-1))/57 with A = (-5+sqrt(57))/16 and B = (-5-sqrt(57))/16.
Comments