Question: Call a positive integer monotonous if it is a one-digit number or its digits, when read from left to right, form either a strictly increasing or decreasing sequence. For example, 3, 23578, and 987620 are monotonous, but 88, 7434, and 23557 are not. How many monotonous positive integers are there?
I attempted to solve the following problem by finding out how many 2-digit and 3-digit monotonous numbers there are and then finding the pattern within them and applying them all the way to the max number of digits in a monotonous number - 9. I figured that when the tens digit is 0, there are 9 possible combinations for the ones digit, when the tens digit is 1, there are 8 possible combinations, and so forth. Thus with 1+2+3+4+5+6+7+8+9 I arrived at 45 increasing monotonous numbers for 2-digit numbers. Then as there is one decreasing monotonous number for every increasing monotonous number, I multiplied it by 2 to get 90 total 2-digit monotonous numbers. However I can not figure out how to accomplish this for 3-digit numbers. Can someone please help me with this, or if there is a more efficient method, could you please explain it? Thanks a lot!