NMO Problem 1

Algebra Level 5

A five-digit positive integer a b c d e 10 abcde_{10} ( a 0 a\neq 0 ) is said to be a range if its digits satisfy the inequalities a < b > c < d > e a<b>c<d>e . For example, 37452 37452 is a range. How many ranges are there? This problem is from the NMO.This problem is part of this set .


The answer is 8622.

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.

1 solution

David Holcer
Mar 21, 2015
1
2
3
4
5
6
count=0
for i in range(10**4,10**5):
    i=str(i)
    if i[0]<i[1]>i[2]<i[3]>i[4]:
        count+=1
print count

:) cheap way again

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...