Project Euler #248: Numbers for which Euler’s totient function equals 13!

Sort by

recency

|

6 Discussions

|

  • + 0 comments

    Just pass the first test, any example to test against it that I can use? how do I know where I'm failing

  • + 0 comments

    from math import factorial

    def gcd(p,q): while q != 0: p, q = q, p%q return p def is_coprime(x, y): return gcd(x, y) == 1

    c=list(map(int,input().rstrip().split())) d=[] n= factorial(c[0]) b= 1 for i in range(n-1,2,-1): if (is_coprime(n,i)==1): b+=1 break d.append(i)

    print(d[len(d)-1])

    this code is working for smaller values but with the inputs of the problem it is showing time out please help

  • + 1 comment

    My program finds 13!'s divisors 66528 and 93600 (among others) because their successor is a prime and combines them. Sorting those roughly 180000 numbers finishes almost instantly but I went the crazy way and preferred ''std::nth_element'' because it is a little bit more efficient - but you can't measure the performance advantage

  • + 0 comments

    To check the cardinality ("checksum") of your sets ϕ-1(m), consider these resources I used:

    In Python testcases, the limit for time is 20 seconds and memory is 512 megabytes. My Python3 code runs under 360 milliseconds; its own prime factorization uses memo-ization.

  • + 0 comments

    can anyone explain the question?