ScratchData LogoScratchData
Back to 3sal2's profile

Happy Numbers

3S3sal2•Created March 13, 2013
Happy Numbers
4
0
114 views
View on Scratch

Description

This sequence will generate a happy sequence for any number n. Your number must be in the set of natural numbers N {0, 1, 2, 3, 4,...}. To get the next number in a happy sequence from a number n, add the squares of the digits in n. If the number reaches 1, it is said to be a happy number, else it is unhappy. Note that an unhappy number n>0 always eventually lands somewhere on the cycle 4, 16, 37, 58, 89, 145, 42, 20, 4... Can you prove this?

Project Details

Project ID3174492
CreatedMarch 13, 2013
Last ModifiedMarch 13, 2013
SharedMarch 13, 2013
Visibilityvisible
CommentsAllowed