This is a riddle in the category math riddles.
Think of a 10-character string with the numbers 0 through 9 and each number appearing exactly once, such that each number (except for the first of the left number) is within 1 of SOME number to its left (e.g. we would say that 6 is within 1 of 5 and 7. Note that 0 is NOT within 1 of 9, i.e. we don't wrap around from 9 to 0).
For example, 3452671089 is correct, because for any number in it (except for the 3 all the way on the left), you can find a number to its left that is with 1 of it. For example, if you look at the number "7", then you can find the number "6" to its left, which is within 1 of it.
Another valid string is 0123456789, which again follows this rule.
An invalid string is 1023457689, because if you look at the number "7", there is no number to its left that is within 1 of it (which would be 6 or 8).
How many 10-character strings are there that meet the described criteria?
No comments:
Post a Comment