4 ms·
Another useful site for that purpose is the Online Encyclopedia of Integer Sequences (https://oeis.org/ https://oeis.org/). A pretty successful strategy for "c
by oxymoron 12y ago
Another useful site for that purpose is the Online Encyclopedia of Integer Sequences (https://oeis.org/ https://oeis.org/).
A pretty successful strategy for "cheating" at Project Euler is to implement a brute force solution to get the first few numbers out of a sequence and look it up in OEIS. If you're lucky, they've already listed a closed form expression for calculating the sequence at an arbitrary index. Drop the expression into your code, and you end up with something that tends to be orders of magnitude more efficient.
Obviously it depends on the structure of the exercise, but it's somewhat surprising how far it can take you.
- troymc 12y agoSome of the OEIS sequences originated with Project Euler problems, so this strategy is closer to cheating than you might think.