An ascending integer is one in which each digit is greater than any other digit preceding it. How many ascending integers are there between 200 and 300?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
I did the same.
solved the same way :)
There are 21 ascending integers namely:234,235,236,237,238,239,245,246,247,248,249,256,257,258, 259,267,268,269,278,279 and 289 .
can u pls elaborate the solution?
This is not a solution!
234 ,235,236,237,238,239....total 6 similarly next in the 245 row it come out total of 5....(trick is to subtract last digit from 10 i.e 10-5 is 5 so total numbers are 5) like this finally it comes out to be in total in 256 row 4 in 267 row 3 in 278 row 2 in 189 row 2 and in 289 row 1 so sum 1 +2+3+4+5+6 is 21
This question is not well asked, the term "preceding" is ambiguous, can't tell if it means from left to right or right to left, or maybe both! In that last case there would be 22 solutions.
Anyway thanks for sharing!
Python solution:
counter = 0
for number in [list(str(number)) for number in range(200, 301)]:
if number[0] < number[1] < number[2]:
counter += 1
print(counter)
Here's my method: Since the hundred's place is 2, an ascending integer cannot be within 200-233. the first number is 234.
So, within 230-240, there are 6 numbers: 234,235,236,237,238,239.
within 240-250,there are 5 numbers: 245,246,247,248,249.
this pattern goes on till 280-290, where there is only one:289.
there is obviously no ascending integer in 290-300.
So, the final answer is =6+5+4+3+2+1=21.
Can be done with hand but some Mathematica Code:
Ascending[x_] :=
IntegerDigits[x][[1]] < IntegerDigits[x][[2]] < IntegerDigits[x][[3]]
Select[Range[200, 300], Ascending]
Returns:
{234, 235, 236, 237, 238, 239, 245, 246, 247, 248, 249, 256, 257,
258, 259, 267, 268, 269, 278, 279, 289}
Thus, there are 21 such integers.
:)
wtf did u just write? can you please explain
Problem Loading...
Note Loading...
Set Loading...
If in the tens place we have 3 we will have 6 choices for the unit place (4,5,6,7,8,9).
If we have 4 , we will have 5 choices.
...
If we have 8 , we will have 1 choice.
Total ways = 2 6 ( 6 + 1 ) = 2 1