defined ruby function for gcd Euclid algorithm implemetations