Find a ten-digit number with the number of zeros in it as the most significant (leftmost) digit, the number of ones as the second most significant digit etc.
Answer
I found this one:
6210001000
My method was to start with 9000000000 and go from there.
9000000000 — start by counting nine 0s
9000000001 — count one 9
9100000001 — count one 1
9200000001 — count two 1s
9210000001 — count one 2
6210000001 — count six 0s
6210001000 — count one 6, zero 9s
This is where the numbers settle.
A different set of steps that counts digits left-to-right, starting from 0000000000. This takes no shortcuts and is complete.
0000000000
How many 0s? A
A000000000 — count A 0s
How many 1s? 0
How many 2s? 0
...
How many 9s? 0
Restart at 0
How many 0s? 9
9000000000 — count nine 0s
How many 1s? 0
How many 2s? 0
...
How many 9s? 1
9000000001 — count one 9
Restart at 0
How many 0s? 8
8000000001 — count eight 0s
How many 1s? 1
How many 2s? 0
...
How many 8s? 1
8100000011 — count one 8
How many 9s? 0
8100000010 — count zero 9s
Restart at 0
How many 0s? 7
7100000010 — count seven 0s
How many 1s? 2
7200000010 — count two 1s
How many 2s? 1
7210000010 — count one 2
How many 3s? 0
...
How many 7s? 1
7210000110 — count one 7
How many 8s? 0
7210000100 — count zero 8s
How many 9s? 0
Restart at 0
How many 0s? 6
6210000100 — count six 0s
How many 1s? 2
6210000100 — no change
How many 2s? 1
6210000100 — no change
How many 3s? 0
...
How many 6s? 1
6210001100 — count one 6
How many 7s? 0
6210001000 — count zero 7s
How many 8s? 0
How many 9s? 0
Restart at 0
How many 0s? 6
6210001000 — no change
How many 1s? 2
6210001000 — no change
How many 2s? 1
6210001000 — no change
How many 3s? 0
...
How many 6s? 1
6210001000 — no change
How many 7s? 0
6210001000 — no change
How many 8s? 0
How many 9s? 0
Reached the end with no change.
Result is 6210001000.
No comments:
Post a Comment