%I #32 Apr 24 2017 07:11:35
%S 1,5,48,660,11760,257040,6652800,198918720,6745939200,255826771200,
%T 10727081164800,492775291008000,24610605962342400,1327677426915840000,
%U 76940526008586240000,4766815315895592960000,314406967644177408000000,21995911456386651463680000
%N Absolute value of determinant of n X n matrix whose entries are the integers from 1 to n^2 spiraling inward, starting in a corner.
%C Starting in the NW or SE corner, the signs are cyclic (+,-,-,+), starting in the NE or SW corner, the signs are always positive.
%H Alois P. Heinz, <a href="/A023999/b023999.txt">Table of n, a(n) for n = 1..200</a>
%H Gaurav Bhatnagar, Christian Krattenthaler, <a href="https://arxiv.org/abs/1704.02859">Spiral determinants</a>, arXiv:1704.02859 [math.CO], 2017.
%H Charles Vanden Eynden, <a href="http://www.jstor.org/stable/2691057">Problem 1517</a>, Mathematics Magazine, Vol. 70, No. 1, Feb., 1997 p. 65.
%F a(n) = (3n-1) * (2n-3)!/(n-2)! for n >= 2. [corrected by _Robert Israel_, Apr 20 2017]
%F E.g.f.: ((-2*x-1)*sqrt(1-4*x)+1-4*x)/(16*x-4). - _Robert Israel_, Apr 20 2017
%e n=4: det of
%e .1..2..3.4
%e 12.13.14.5
%e 11.16.15.6
%e 10..9..8.7
%p a:= proc(n) option remember; `if`(n<2, (3*n+1)/4,
%p 4*(3*n-1)*(2*n-5)*(2*n-3) *a(n-2) /(3*n-7))
%p end:
%p seq(a(n), n=1..20); # _Alois P. Heinz_, Jan 21 2014
%t M[0, 0] = 1;
%t M[i_, j_] := If[i <= j,
%t If[i + j >= 0, If[i != j, M[i + 1, j] + 1, M[i, j - 1] + 1],
%t M[i, j + 1] + 1],
%t If[i + j > 1, M[i, j - 1] + 1, M[i - 1, j] + 1]
%t ]
%t M[n_] := n^2 + 1 - If[EvenQ[n],
%t Table[M[i, j], {j, n/2, -n/2 + 1, -1}, {i, -n/2 + 1, n/2}],
%t Table[M[i, j], {j, (n - 1)/2, -(n - 1)/2, -1}, {i, -(n - 1)/2, (n - 1)/2}]]
%t a[n_]:=Det[M[n]] (* _Christian Krattenthaler_, Apr 19 2017 *)
%o (Maxima) A023999(n):=if n=1 then 1 else 2*((-1)^((n+4)*(n-1))/2 *(3*n-1) * (2*n-3)!/(n-2)!)$
%o makelist(A023999(n),n,1,30); /* _Martin Ettl_, Nov 05 2012 */
%Y Cf. A079340, A078475, A067276, A052182.
%Y Main diagonal of A226167, A126224 (signed version). - _Alois P. Heinz_, Jan 21 2014
%K nonn
%O 1,2
%A Charles Diminnie (charles.diminnie(AT)rampo.angelo.edu)
%E Edited and extended by _Robert G. Wilson v_, May 07 2003