This blog has moved to Medium

Subscribe via email


First non-trivial problem in Project Euler

So far, all the problems I saw were trivial, at least in the sense that some brute-force approach would work (with some optimizations perhaps).

Problem 30 is different.

After solving it, I looked in the forum. The first entry was this:


I have a question. Can you actually be sure that there is no higher number that can fit this description?
I just let my program run until it doesn’t seem to find any more solution and then manually stop it. Doesn’t feel like its a very pretty solution to it though.

You can’t formally solve this problem without a correctness proof. There is a limit beyond which there is no chance to encounter numbers relevant to the problem.
How to prove the limit? I leave that as an exercise to the reader (hint: use logarithms).