Number Theory

Find a 4 digit number represented as a b c d \overline{abcd} which have the following property:

a b c d = a a + b b + c c + d d \overline{abcd} = a^a + b^b + c^c + d^d

Clarification: a , b , c , d a,b,c,d are not necessarily distinct


The answer is 3435.

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.

2 solutions

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
a = 1 #The first digit of a non-single digit number cannot be zero
while a<=9:
    b=0
    while b<=9:
        c=0
        while c<=9:
            d=1
            while d<=9:
                if 1000*a + 100*b + 10*c + d == a**a + b**b + c**c + d**d: #A number with 4 digits a,b,c,d can be written as 1000*a + 100*b + 10*c + d
                    print(1000*a + 100*b + 10*c + d)
                d += 1
            c += 1
        b += 1
    a += 1

Giorgio Coniglio
Aug 7, 2016

3435 = 3^3 + 4^4 + 3^3 + 5^5

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...