Google Interview Question

Write an algorithm to find if a number is happy