changed happy number to more idiomatic ruby style