Hacker News new | past | comments | ask | show | jobs | submit login

yeah that's weird - its kind of a pointless comment without an included algorithm or something



I guess the margin was too small to contain it.


There’s probably a smart way to rule out a lot of cases so you only have to check a relatively small number of candidates. It would be good to know what it is.


Here's a really dumb algorithm:

    for i in range(1, 10**10):
        for k in range(1, 5):
            s = str(pow(2, i, 10**(10**k)))
            if '1' in s or '3' in s or '5' in s or '7' in s or '9' in s:
                break
        else:
            print(2**i)
It's really easily to parallelize, I was able to run it up to 10**8 in about 15min, so you would be able to run it up to 10**10 in a few hours with parallelization.


It's not 10^10 ≈ 2^33 though, it's 2^(10^10) = 2^10000000000, or about 9 999 999 967 orders of magnitude more.


You only need to check the actual powers of two.

Checking about 10^10 of them is just about doable as vhcr correctly showed. (I mean it wasn't optimal, but 'leave this running for 400 hours' is far from impossible)


It is 10^10 cases, checking numbers up to 2^(10^10). The numbers themselves are pretty big (~9 gigabytes each if you want to write full binary representation), but nothing that modern computers can't handle.


Just by sheer numbers, the comment you're replying to must be one of the provably wrong-est comments in history of hacker news =).




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: