Timeline for Find whether a number is happy or not?
Current License: CC BY-SA 3.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 25, 2011 at 23:57 | comment | added | Casey | That is the same as a <= 4 and a <= 1. If the cycle has a 1 in it then it is happy, and if it has a 4 in it, then it is not happy. See the wikipedia section about the unhappy cycle. So once the value of a is 4 or less, he checks if a is -- the result of that is your answer. | |
| Apr 25, 2011 at 22:42 | comment | added | Mr. Llama | Ok, so I kinda get how this works (Literally taking each number, splitting it and adding the square of each digit), but what's with the stop condition of (a < 5) and using (a < 2) to decide if it's happy or not? I don't question the validity, just the logic. | |
| Apr 25, 2011 at 19:19 | history | edited | Ventero | CC BY-SA 3.0 | deleted 4 characters in body |
| Apr 25, 2011 at 19:10 | history | edited | Ventero | CC BY-SA 3.0 | deleted 3 characters in body; deleted 1 characters in body |
| Apr 25, 2011 at 19:00 | history | edited | Ventero | CC BY-SA 3.0 | deleted 1 characters in body; edited body |
| Apr 25, 2011 at 18:52 | history | edited | Ventero | CC BY-SA 3.0 | deleted 3 characters in body; deleted 2 characters in body |
| Apr 25, 2011 at 18:45 | history | answered | Ventero | CC BY-SA 3.0 |