Q:

Greatest common divisor of multiple (more than 2) numbers

I am seeking for the easiest solution to get the greatest common divisor of multiple values. Something like:
x=gcd_array(30,40,35) % Should return 5
x=gcd_array(30,40) % Should return 10

How would you solve this?
Many thanks!

A:

gcd(a,b,c) = gcd(a,gcd(b,c))

Which means you can use recursion.
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.73.3&rep=rep1&type=pdf&ei=90jgT9KPAtLS4QSNlOGdDQ&usg=AFQjCNGH_GewFofxWPfX2BDN6T5NF9PxAA

