// output of ./demo/seq/A003043-demo.cc: // Description: //% OEIS sequence A003043: //% Number of Hamiltonian paths (or Gray codes) on n-cube with a marked starting node. //% Computation as Permutations with restricted prefixes. //% Also A059783: paths from vec(0) to vec(1). arg 1: 8 == n [Permutations of {1, 2, ..., n}] default=8 arg 2: 0 == c [Condition function: (0: A003043, Hamiltonian paths), (1: A059783, paths from vec(0) to vec(1))] default=0 A003043, Hamiltonian paths: 1: [ 0 1 3 2 6 4 5 7 ] 2: [ 0 1 3 2 6 7 5 4 ] 3: [ 0 1 3 7 5 4 6 2 ] 4: [ 0 1 5 4 6 2 3 7 ] 5: [ 0 1 5 4 6 7 3 2 ] 6: [ 0 1 5 7 3 2 6 4 ] 7: [ 0 2 3 1 5 4 6 7 ] 8: [ 0 2 3 1 5 7 6 4 ] 9: [ 0 2 3 7 6 4 5 1 ] 10: [ 0 2 6 4 5 1 3 7 ] 11: [ 0 2 6 4 5 7 3 1 ] 12: [ 0 2 6 7 3 1 5 4 ] 13: [ 0 4 5 1 3 2 6 7 ] 14: [ 0 4 5 1 3 7 6 2 ] 15: [ 0 4 5 7 6 2 3 1 ] 16: [ 0 4 6 2 3 1 5 7 ] 17: [ 0 4 6 2 3 7 5 1 ] 18: [ 0 4 6 7 5 1 3 2 ] ct=18