Skip to content

Instantly share code, notes, and snippets.

@somebody1234
Last active June 8, 2018 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save somebody1234/a469852fbba250f98a08a01954c21017 to your computer and use it in GitHub Desktop.
Save somebody1234/a469852fbba250f98a08a01954c21017 to your computer and use it in GitHub Desktop.
bin(): n leading 1s trailing 0s
1 1 0
10 1 1
11 1 0
100 10 1
101 1 10
110 11 1
111 1 0
1000 11 1
1001 10 10
1010 101 1
1011 1 11
1100 110 1
1101 11 10
1110 100 1
1111 1 0
10000 100 1
10001 11 10
10010 1001 1
10011 10 11
10100 110 1
10101 101 10
10110 1011 1
10111 1 100
11000 1010 1
11001 110 10
11010 1001 1
11011 11 11
11100 1110 1
11101 100 10
11110 101 1
11111 1 0
100000 101 1
100001 100 10
100010 1100 1
100011 11 11
100100 1 1
100101 1001 10
100110 1100 1
100111 10 100
101000 1010 1
101001 110 10
101010 111 1
101011 101 11
101100 1100 1
101101 1011 10
101110 10111 1
101111 1 101
110000 10101 1
110001 1010 10
110010 1000 1
110011 110 11
110100 11010 1
110101 1001 10
110110 10100 1
110111 11 100
111000 1001 1
111001 1110 10
111010 11101 1
111011 100 11
111100 11110 1
111101 101 10
111110 110 1
111111 1 0
1000000 110 1
1000001 101 10
1000010 100001 1
1000011 100 11
1000100 10110 1
1000101 1100 10
1000110 100011 1
1000111 11 100
1001000 1001 1
1001001 1 10
1001010 10100 1
1001011 1001 11
1001100 11110 1
1001101 1100 10
1001110 100111 1
1001111 10 101
1010000 11011 1
1010001 1010 10
1010010 101001 1
1010011 110 11
1010100 1000 1
1010101 111 10
1010110 11100 1
1010111 101 100
1011000 1011 1
1011001 1100 10
1011010 1100 1
1011011 1011 11
1011100 1010 1
1011101 10111 10
1011110 1 1
1011111 1 110
1100000 11000 1
1100001 10101 10
1100010 1111 1
1100011 1010 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment