Huge Sum

0 2 4 6 2012 2014 2016 0 \, 2 \, 4 \, 6 \dots 2012 \, 2014 \, 2016 1 3 5 7 2013 2015 2017 1 \, 3 \, 5 \, 7 \dots 2013 \, 2015 \, 2017 The above expressions shows the concatenation of the the even and odd numbers less than or equal to 2017 respectively.

What is the sum of the digits of the number obtained as the sum of the two numbers described above?


The answer is 14986.

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

Bill Bell
Feb 19, 2016
1
2
3
4
first=int(''.join([str(i) for i in range(0,2018,2)]))
second=int(''.join([str(i) for i in range(1,2019,2)]))

print (sum(int(c) for c in str(first+second)))

Nice three-liner!

Harsh Shrivastava - 5 years, 3 months ago

Log in to reply

Thank you! Very generous.

Bill Bell - 5 years, 3 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...