The squares fit together perfectly because the ratio between the numbers in the Fibonacci sequence is very close to the golden ratio [1], which is approximately 1.618034. The larger the numbers in the Fibonacci sequence, the closer the ratio is to the golden ratio.

What is nice about this method is that first you can change you seeds to anything you want. This is nice to find fib like sequences. For example Lucas numbers are seeded with 2 and 1. Second, you can put your check for square inline and not completely recalculate the sequence each time.




Perfect Numbers And Fibonacci Sequences