From: Matthew Moss Date: 2006-09-07T11:46:58+09:00 Subject: Re: [QUIZ] Happy Numbers (#93) My bit o' solution... only had a few minutes to do a few lines, it's about as small and compact as I can get a happy test without golfing it: class Integer def happy? return false if zero? return false if (self ^ 4).zero? return true if (self ^ 1).zero? to_s.split(//).inject(0) { |s,x| s + (x.to_i ** 2) }.happy? end end