Hello.I have a relatively simple question but if you could help me it would be appreciated.I need a script which have a submit form, and after submiting it should check if the number submited by the user is happy or not.The definition for happy numbers is here :
http://en.wikipedia.org/wiki/Happy_number
Every new number from the current check should be saved in array and call back later if needed, but first thing first, If someone could help me with the script for checking if the number is happy or not would be more than enough to begin with.
Thanks
Leron
Happy numbers script
Moderator: General Moderators
Re: Happy numbers script
1. Figure out how long the number is, in digits.
2. Look at each digit.
3. Add its square to a counter.
4. ???
5. Profit.
2. Look at each digit.
3. Add its square to a counter.
4. ???
5. Profit.
Re: Happy numbers script
That really helps.... 