Inspired by your idea.

class Solution {
public:
bool isHappy(int n) {
while(n != 1){
n = findNext(n);
if(n == 4) return false;
}
return true;
}
int findNext(int n){
int sum = 0;
while(n){
sum += (n % 10) * (n % 10);
n /= 10;
}
return sum;
}
};

There are some numbers, which will show up in every loop of the non-happy number. So, we could pick up one of these numbers to determine if it is a happy number.

2 -> [ 4 -> 16 -> 37 -> 58 -> 89 -> 145 -> 42 ] -> 18 -> 65 -> 61 ( 61 = 16, 16 is the number )

3 -> 9 -> 81 -> 65 -> 61 ( 61 = 16, 16 is in the number )

5 -> 25 -> 29 -> 85 ( 85 = 58, 58 is in the number )

6 -> 36 -> 45 -> 41 -> 17 -> 50 -> 25 -> 29 -> 85 ( 85 = 58, 58 is in the number )

8 -> 64 -> 52 -> 29 -> 85 ( 85 = 58, 58 is in the number )

I have checked those numbers : 4, 16, 37, 58, 89, 145, 42 which can be used to differentiate happy numbers.

But I cannot prove it mathematically.