An interesting number

Which 4-digit number, when multiplied by 4, has the same digits as in the original number, but in the reverse order?


The answer is 2178.

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

Code

1
2
3
4
5
6
for a in range(1,10):
    for b in range(0,10):
        for c in range(0,10):
            for d in range(0,10):
                if (4*(1000*a+100*b+10*c+d)==(1000*d+100*c+10*b+a)):
                    print(1000*a+100*b+10*c+d)

Output

1
2178

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...