ROSECODE 202
Happy numbers
Let f(n) be the sum of the squares of the digits of n. Iterate this process, if we can reach 1 in this sequence then we say n is a happy number. H(n) denotes the number of (positive) happy numbers up to n. For example n=736 is a happy number as the iterated sequence is 736,94,97,130,10,1. Find H(12345678).
Example: H(1000)=143.
Example: H(1000)=143.