Project Euler #63: Powerful digit counts

  • + 0 comments

    Here's fastest python code.

    # Enter your code here. Read input from STDIN. Print output to STDOUT
    import math
    N = int(input())
    for i in range(1, 10):
        if int(math.log10(i) * N) == N - 1:
            print(i ** N)