Special Permutations
Count arrangements where neighbours divide one another by a bitmask DP over the used numbers and the last number placed.
Count arrangements where neighbours divide one another by a bitmask DP over the used numbers and the last number placed.