Don't make it any harder than it has to be.
def check_ip(ip)
'62.0.0.0' < ip and ip < '62.255.255.255'
end
check_ip '62.156.244.13' #=> true
Edit: Or, if you're using Rails / ActiveSupport:
def check_ip(ip)
ip.starts_with? '62'
end
check_ip '62.156.244.13' #=> true