>
>  This should be faster than my previous solution (if it matters).
>



def try2(n)
  s, q = n.to_s.size, n*n
  (s...s*2).each do|x|
    y = 10**x
    return true if n == q/y+q%y
  end
  false
end



Harry