2002 Math OSK, Number 10: Digit values

Number Theory Level pending

The digits 1, 9, 9, 8 in 1998 has a total value of 1 + 9 + 9 + 8 = 27. The next number that has a total digit value of 27 happens between years of...

3101 and 9900 9901 and 9999 2901 and 3100 2701 and 2900 2500 and 2700

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

Alex Zhong
Apr 13, 2015

Python

for n in range(1998,5000):

    s = sum(map(int,str(n)))

    if s== 27:

        print (n,s)

1998 27

2799 27

2889 27

2898 27

2979 27

2988 27

2997 27

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...