login
Determinant of n X n matrix whose element A(i,j) is 1 if i=j, i if n=i+j and 0 otherwise.
1

%I #11 Jan 08 2019 04:47:54

%S 1,1,-1,-2,15,28,-495,-924,29393,55200,-2755377,-5206760,374909535,

%T 712318464,-69864169375,-133355433456,17088978269025,32747341496320,

%U -5311777786094241,-10212994682100000,2045230826019387119,3943711514611814400,-955583772509043759375

%N Determinant of n X n matrix whose element A(i,j) is 1 if i=j, i if n=i+j and 0 otherwise.

%H Alois P. Heinz, <a href="/A071999/b071999.txt">Table of n, a(n) for n = 1..200</a>

%F a(n) ~ -(-1)^(n*(n+1)/2) * ((n-2)! * (1 + (-1)^n) + (n-1)! * (1 - (-1)^n)/2). - _Vaclav Kotesovec_, Jan 08 2019

%p with(LinearAlgebra):

%p a:= n-> Determinant(Matrix(n, (i, j)->

%p `if`(i=j, 1, `if`(n=i+j, i, 0)))):

%p seq(a(n), n=1..25); # _Alois P. Heinz_, Nov 13 2015

%t Table[ Det[ Table[ If[i == j, 1, If[n == j + i, i, 0]], {i, 1, n}, {j, 1, n}]], {n, 1, 22}]

%o (PARI) a(n) = matdet(matrix(n, n, i, j, if(i==j, 1, if(n==i+j, i, 0)))) \\ _Colin Barker_, Nov 13 2015

%K sign

%O 1,4

%A _Robert G. Wilson v_, Jun 19 2002