Cubes of digit

Find the sum of the all possible values of a b c \overline{abc} , where the equation below is true. a b c = a 3 + b 3 + c 3 \overline{abc}=a^3+b^3+c^3

Note: a , b , c a, b, c are non-negative single digits. The a b c \overline{abc} is a three-digit integer.


The answer is 1301.

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

Jesse Nieminen
Aug 9, 2017
1
2
3
4
5
6
7
8
sum = 0
for a in range(1, 10):
    for b in range(10):
        for c in range(10):
            abc = 100 * a + 10 * b + c
            if abc == a ** 3 + b ** 3 + c ** 3:
                sum += abc
print(sum)

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...