Calculate whether numbers are happy