According to my logic and also manually tracking, 3 should be a happy number. But Leet OJ is says false. Can anyone tell me why?

```
public class Solution {
public boolean isHappy(int n) {
int sum=0;
Set<Integer> s = new HashSet<Integer>();
s.add(new Integer(n));
while (n!=1) {
while (n>=1) {
sum = sum + (n%10*n%10);
n = n/10;
}
if (s.contains(new Integer(sum))) {
return false;
}
s.add(new Integer(sum));
n = sum;
sum = 0;
}
return true;
}
}
```