Euclids algo is a nice one to find out the lowest common divisor for 2 given positive integers. I am once again going through Donald Knuth just for fun. Enjoy talking about it and posting your own suggestions / code on the following URL. You can also find my intial code on that link.
Will keep posting and give you more of this useless (in terms that it does not help me in my daily work and probably will not help you as well, unless you are mathemacian but then you probably have more advanced libraries to carry out such stuff hence I am convinced that it is totally useless) albeit fun stuff.