A283184 a(n) is the number of symmetric permutations (p(1),p(2),...,p(m)) of (1,2,...,m), m=2n or m=2n+1, with p(m+1-k) = m+1-p(k) for 1<=k<=m, such that adjacent numbers do not differ by 1. a(n) is also the number of point-symmetric arrangements of m non-attacking kings on an m X m board, with one in each row and column.
1, 0, 2, 14, 122, 1262, 15466, 219646, 3551194, 64431374, 1296712778, 28672204574, 691007296954, 18029138380846, 506320912190506, 15228632768870462, 488405396197019546, 16638380026019579726, 600022595692147574794, 22836184629309211495774, 914717041435012519583098
Offset: 0
Keywords
Examples
Example 1, m=5: The matrix, transforming 12345 into 41352, can also be thought of as a chessboard; each "1" is a king. ./0 0 0 1 0\ /1\ /4\ | 1 0 0 0 0 | |2| |1| | 0 0 1 0 0 |*|3|=|3| | 0 0 0 0 1 | |4| |5| .\0 1 0 0 0/ \5/ \2/ Example 2, m=6: q is a 3-permutation not ending on 3: q g(q) 2^(g(q)+1) Symmetric 6-permutations, |p(j+1)-p(j)|>1 132 1 4 135246, 635241, 142536, 642531 231 1 4 531642, 536142, 241635, 246135 312 1 4 315264, 362514, 462513, 415263 321 0 2 426153, 351624 Result: a(3)=14.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..400 (terms n = 0..50 from Gerhard Kirchner)
- Gerhard Kirchner, Fast recurrence
Crossrefs
Cf. A002464.
Programs
-
Maple
b:= proc(n, s, l) option remember; `if`(s={}, `if`(abs(n/2-l)<1, 0, 1), add(add(`if`(abs(j-l)=1, 0, b(n, s minus {i}, i)), j=[i, n-i]), i=s)) end: a:= n-> b(2*n+1, {$1..n}, -1): seq(a(n), n=0..10); # Alois P. Heinz, Mar 15 2017 # second Maple program: a:= proc(n) option remember; `if`(n<4, (n-1)* (7*n^2-5*n-6)/6, (2*n+1)*a(n-1) -(2*n-5)* (a(n-2)+a(n-3)) +(2*n-6)*a(n-4)) end: seq(a(n), n=0..20); # Alois P. Heinz, Mar 17 2017
-
Mathematica
a[n_] := a[n] = If[n<4, (n-1)*(7n^2-5n-6)/6, (2n+1)*a[n-1] - (2n-5)*(a[n-2] + a[n-3]) + (2n-6)*a[n-4]]; Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Mar 18 2017, after Alois P. Heinz *)
-
PARI
a(n)={subst(serlaplace(polcoef((1 - x)/(1 + (1 - 2*y)*x + 2*y*x^2) + O(x*x^n), n)), y, 1)} \\ Andrew Howroyd, Mar 01 2024
Formula
Let q be any permutation (p(1), p(2),..., p(n)) with p(n) < n and g(q) = Sum_{j=1..n-1} sgn(|p(j+1)-p(j)|-1).
a(n) = Sum_{each q} 2^(g(q)+1).
a(n) ~ exp(-1) * 2^n * n!. - Vaclav Kotesovec, Apr 20 2017
Extensions
a(14)-a(20) from Alois P. Heinz, Mar 15 2017
Comments