Happy Numbers

For any integer, take the sum of the squares of its digits. Take this result and find the sum of the squares of its digits. Repeat. If the iteration ends in 1, then the original number is a happy number. How many happy numbers are there less than 20? Less than 30? Can you find a pattern?

Example with the integer 12:
Take the sum of the squares of its digits, 12 + 22 = 5;
Continue with 52 = 25;
25 => 22 + 52 = 29;
29 => 22 + 92 = 85;
85 => 82 + 52 = 89. . .keep going to find out if 12 is happy!