Happy number checker

10 Aug 2021

Been using python to calculate happy numbers. Happy numbers are numbers which eventually reaches 1 when replaced by the sum of the square of each digit. Currently it can handle over a 1000 numbers a second and uses a python dicitionary to cache previously checked numbers to speed up calculations. However this will eventually produce a memory error as the dictionary gets bigger. I am looking into ways to make it more efficient such as only storing happy numbers and checking if the current number’s sum has already been checked as a happy number.

Link to code Repo