A mathsy journey through Project Euler!
I avoid brute forcing or iterating as much as I can, prefering closed formulas or a mathematical interpretation when possible.
P1: closed formula using the Principle of Inclusion and Exclusion (PIE)
P2: instead of iterating over the Fibonacci numbers, I only generate the even ones
P6: closed formulas for square of sum and sum of squares
P9: Euclid's formula is used to look for a Pythagorean triplet
P15: combinatorial interpretation of the classic "walk the grid" problem
P28: instead of iterating over the spiral, I exploit the fact that one diagonal is the square of odd numbers and rings have even side length
P31: instead of using a classic recursion scheme, I implement the ring of polynomials and use a generating function
P85: combinatorial interpretation of the classic "rectangles in a rectangle" and some basic algebra to reduce the search space