Lucas numbers stay whole

You will learn

Why phi^(2n) + phi^(-2n) is always a whole number, and where the 3 of phi^2 + 1/phi^2 = 3 comes from.

phi is irrational, yet phi^2 + phi^(-2) is exactly 3. That is no accident: phi^k + (-1/phi)^k is the Lucas number L_k, and Lucas numbers are whole: 2, 1, 3, 4, 7, 11, 18 and on, each the sum of the two before it. The spec computes phi^(2n) + phi^(-2n) in f64 and checks it against L_2n for n from 0 to 6, within a tolerance of 1e-9. The 3 of the project motto is L_2.

Open the interactive lesson →