OFFSET
1,4
COMMENTS
LINKS
EXAMPLE
For n = 4 the a(4) = 2 solutions are [2,4,1,3] and [3,1,4,2].
For n = 5 the a(5) = 2 solutions are [3,1,5,2,4] and [2,4,1,5,3].
PROG
(Haskell)
pairs l = zip l (drop 1 l)
d n = filter (all (uncurry (/=)) . zip [1..]) $ Data.List.permutations [1..n]
a n = length $ filter (all ((1<) . abs . uncurry (-)) . pairs) $ d n
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Peter Kagey, Jun 06 2017
EXTENSIONS
a(12)-a(16) from Lars Blomberg, Jul 05 2017
STATUS
approved