Project Euler #29: Distinct powers

  • + 0 comments

    n=int(input()) l={0} for i in range(2,n+1): for j in range(2,n+1): l.add(pow(i,j))
    print(len(l)-1)

    problem on this code why it fail in many test cases