From Wikipedia, the free encyclopedia:

 A happy number is defined by the following process:
 Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals   1   (where it will stay),   or it loops endlessly in a cycle which does not include   1.   


 Those numbers for which this process end in   1   are       happy   numbers,   
 while   those numbers   that   do   not   end in   1   are   unhappy   numbers. 


Task

Find and print the first   8   happy numbers.

Display an example of your output here on this page.



See also

   The OEIS entry:   The     happy numbers:   A007770
   The OEIS entry:   The unhappy numbers;   A031177


     ∇ HappyNumbers arg;⎕IO;∆roof;∆first;bin;iroof
[1]   ⍝0: Happy number
[2]   ⍝1: http://rosettacode.org/wiki/Happy_numbers
[3]    ⎕IO←1                              ⍝ Index origin
[4]    ∆roof ∆first←2↑arg,10              ⍝
[5]
[6]    bin←{
[7]        ⍺←⍬                            ⍝ Default left arg
[8]        ⍵=1:1                          ⍝ Always happy!
[9]
[10]       numbers←⍎¨1⊂⍕⍵                 ⍝ Split numbers into parts
[11]       next←+/{⍵*2}¨numbers           ⍝ Sum and square of numbers
[12]
[13]       next∊⍺:0                       ⍝ Return 0, if already exists
[14]       (⍺,next)∇ next                 ⍝ Check next number (recursive)
[15]
[16]   }¨iroof←⍳∆roof                     ⍝ Does all numbers upto ∆root smiles?
[17]
[18]   ⎕←~∘0¨∆first↑bin/iroof             ⍝ Show ∆first numbers, but not 0
     ∇