A117542 Number of permutations P of 1..n such that in P and in the inverse of P, every pair of adjacent numbers and the first and last number, are relatively prime.
1, 2, 6, 8, 36, 16, 127, 320, 581, 1564, 13565, 13760, 149186, 773727, 540538
Offset: 1
Keywords
Examples
a(4)=8, since the 8 permutations (1,2,3,4), (1,4,3,2), (2,1,4,3), (2,3,4,1), (4,1,2,3), (3,2,1,4), (3,4,1,2), (4,3,2,1) satisfy the property.
Comments