The even Fibonacci terms occur three places apart. For Project Euler’s even-Fibonacci sum, a recurrence for these terms skips the odd numbers entirely:
Starting with 2 and 8 gives 34, 144, 610, and so on. Each step produces another even term, with no parity check needed.
Lagrange multipliers give a compact formula for the point on a plane nearest to a given point. In vector notation, the geometry is straightforward: move along the plane’s normal until you reach the plane.
For a plane with a nonzero normal , the point closest to is:
For the unit-normal form, set and , so the plane equation becomes . The closest point is then:
Here is the plane’s signed distance from the origin in the unit normal’s direction. The quantity in parentheses is the point’s signed perpendicular displacement from the plane. Subtracting that displacement along the unit normal gives the closest point on the plane.