Write an algorithm to determine whether a number is happy.
A happy number repeatedly replaces itself with the sum of the squares of its digits. Return True if the process eventually reaches 1; otherwise, return False when it enters a cycle that does not include 1.
Implement is_happy(n), which accepts a positive integer and returns a Boolean. For example, 19 is happy because 19 -> 82 -> 68 -> 100 -> 1, while 2 is not happy because its sequence cycles without reaching 1.
def is_happy(n):