[jonathan@c2q-q9400 ~]$ perl math02.pl 8
It should move [80] steps!
0: [11111111-00000000]
1: [1111111-100000000]
2: [111111101-0000000]
3: [1111111010-000000]
4: [11111110-01000000]
5: [111111-0101000000]
6: [11111-10101000000]
7: [1111101-101000000]
8: [111110101-1000000]
9: [11111010101-00000]
10: [111110101010-0000]
11: [1111101010-010000]
12: [11111010-01010000]
13: [111110-0101010000]
14: [1111-010101010000]
15: [111-1010101010000]
16: [11101-10101010000]
17: [1110101-101010000]
18: [111010101-1010000]
19: [11101010101-10000]
20: [1110101010101-000]
21: [11101010101010-00]
22: [111010101010-0100]
23: [1110101010-010100]
24: [11101010-01010100]
25: [111010-0101010100]
26: [1110-010101010100]
27: [11-01010101010100]
28: [1-101010101010100]
29: [101-1010101010100]
30: [10101-10101010100]
31: [1010101-101010100]
32: [101010101-1010100]
33: [10101010101-10100]
34: [1010101010101-100]
35: [101010101010101-0]
36: [1010101010101010-]
37: [10101010101010-01]
38: [101010101010-0101]
39: [1010101010-010101]
40: [10101010-01010101]
41: [101010-0101010101]
42: [1010-010101010101]
43: [10-01010101010101]
44: [-0101010101010101]
45: [0-101010101010101]
46: [001-1010101010101]
47: [00101-10101010101]
48: [0010101-101010101]
49: [001010101-1010101]
50: [00101010101-10101]
51: [0010101010101-101]
52: [001010101010101-1]
53: [00101010101010-11]
54: [001010101010-0111]
55: [0010101010-010111]
56: [00101010-01010111]
57: [001010-0101010111]
58: [0010-010101010111]
59: [00-01010101010111]
60: [000-1010101010111]
61: [00001-10101010111]
62: [0000101-101010111]
63: [000010101-1010111]
64: [00001010101-10111]
65: [0000101010101-111]
66: [000010101010-1111]
67: [0000101010-011111]
68: [00001010-01011111]
69: [000010-0101011111]
70: [0000-010101011111]
71: [00000-10101011111]
72: [0000001-101011111]
73: [000000101-1011111]
74: [00000010101-11111]
75: [0000001010-111111]
76: [00000010-01111111]
77: [000000-0101111111]
78: [0000000-101111111]
79: [000000001-1111111]
80: [00000000-11111111]