A321956 Number of permutations of 3 indistinguishable copies of 1,...,n such that the first and second copies of j are adjacent and there are exactly j-1 numbers between the second and the third copy of j.
1, 1, 0, 2, 4, 0, 16, 40, 0, 456, 1759, 0, 34636, 175198, 0, 5494621, 34043062, 0
Offset: 0
Examples
a(3) = 2: 111332232, 332232111. a(4) = 4: 111334432242, 332232441114, 334432242111, 441114332232.
Links
- Eric Weisstein's World of Mathematics, Langford's Problem
- Wikipedia, Dancing Links
- Wikipedia, Langford pairing
Formula
a(n) = 0 for n == 2 (mod 3).