Sunday, January 9, 2011

HAPPY NUMBERS

http://en.wikipedia.org/wiki/Happy_number


1, 7, 10, 13, 19, 23, 28, 31, 32, 44, 49, 68, 70, 79, 82, 86, 91, 94, 97, 100, 103, 109, 129, 130, 133, 139, 167, 176, 188, 190, 192, 193, 203, 208, 219, 226, 230, 236, 239, 262, 263, 280, 291, 293, 301, 302, 310, 313, 319, 320, 326, 329, 331, 338

Take for example 13. It is a Happy number.

(a) If you insert 0 to 13, you get, 103, 130
both of them are happy numbers.
Take 23, you get 203 and 230 ---> both are happy numbers.
What if you insert 2 zeros, would you get happy numbers?
Would this method always work?

(b) Now, if you insert 1 to say 13, you get, 113 (not a happy number, but a sad number) and 131 (a sad number)

(c) If you insert 2, it doesn't work

(d) If you insert 3 to 19, you get, 139 and 193 (both are happy numbers)

Would that always work?

Try inserting 4, 5, 6, 7, 8, and 9

No comments:

Post a Comment