The 5th Challenging Number Game

Number Theory Level pending

Find the largest 7-digit number that satisfies: a b c d e f g = a 7 + b 7 + c 7 + d 7 + e 7 + f 7 + g 7 \\ \overline { abcdefg } ={ a }^{ 7 }+{ b }^{ 7 }+{ c }^{ 7 }+{ d }^{ 7 }+{ e }^{ 7 }+{ f }^{ 7 }+{ g }^{ 7 }

...Oh wait, too easy! Find the product of all 7 digits of that number: a b c d e f g abcdefg\\

Up until now, this is the last problem in my set, Game Of Numbers. But that's not THE END...


The answer is 14580.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
def digits(n, func, combine):
    if n < 10:
        return func(n)
    else:
        return combine(func(n % 10), digits(n // 10, func, combine))


def find_number(number_of_digits):
    for i in range((10 ** number_of_digits) - 1, 10 ** (number_of_digits - 1), -1):
        if i == digits(i, lambda x: x**number_of_digits, lambda x,y: x+y):
            print(i, ", product of digits: ", digits(i, lambda x: x, lambda x ,y: x * y))
            break

find_number(7)

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...