After trying multiple solutions I found one that works. It involves calculating the remainder for the long division of the number, and once it reaches a remainder I've already got, it's going to recur again.
After trying multiple solutions I found one that works. It involves calculating the remainder for the long division of the number, and once it reaches a remainder I've already got, it's going to recur again.

jamtot/PyProjectEuler,jamtot/PyProjectEuler