Originally written on a TI-84. Translated to python when teaching a friend how to code.