User talk:Monochromeninja

From Esolang
Jump to navigation Jump to search

Help on Project Euler problem 10 implementation

The following is my implementation of Project Euler Problem 10 in Python. It seems that it is incorrect, could you please fix it?

primes=[]
sieve=[0]*2000005
for i in range(2,2000000):
    if not sieve[i]:
        primes.append(i)
    for j in primes:
        if j*i>=2000000:
            break
        sieve[j*i]=1
        if not i%j:
            break
print(sum(primes))
By all accounts, this seems right to me. It even agrees with a list of Project Euler solutions that I found, so I'm not sure what the problem is. Maybe it's an issue with their site? (Also, sorry for responding more than a year later...) --Monochromeninja, Python programmer (talk) 12:29, 23 October 2024 (UTC)
Update: Yep, it's a problem with the site. I just checked the way that it's done in code, and they use MD5 and compare the hash to the hash of the correct answer.
Your hash:  d915b2a9ac8749a6b837404815f1ae25
Their hash: d915b2a9ac8749a6b837404815f1a25
They're MISSING A CHARACTER, argh. I'll try to get that fixed. --Monochromeninja, Python programmer (talk) 12:35, 23 October 2024 (UTC)