OFFSET
0,5
COMMENTS
For n > 1, this is the number of ways of rearranging guests sitting at a circular table such that a guest may stay in the same seat, but cannot move exactly one seat to their left or right.
The recurrence comes from Doron Zeilberger's MENAGE program, available via the arXiv reference.
LINKS
Peter Kagey, Table of n, a(n) for n = 0..400
D. Zeilberger, Automatic Enumeration of Generalized Menage Numbers, arXiv preprint arXiv:1401.1089 [math.CO], 2014.
FORMULA
EXAMPLE
For n = 5, the a(5) = 13 permutations are 12345, 12543, 14325, 14523, 15342, 32145, 34125, 34512, 35142, 42315, 42513, 45123, and 45312.
The first letter is never 2 or 5, the second letter is never 1 or 3, the third letter is never 2 or 4, the fourth letter is never 3 or 5 and the fifth letter is never 1 or 4.
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Kagey, May 27 2022
STATUS
approved