I remixed it since you can remove a sqrt and the fibonachi sequence and therefore make it faster... maybe the proof for the cycle can be easier now everything by @AO-85757