Created happy number program in SWI-Prolog