Possible Duplicate:
HCF/LCM problem
Given some positive integers $a_i, a_{i+1},\dots,a_n$ we need to find as large as possible number $X$ such that $a_i \pmod x = a_{i+1} \pmod x = \dots = a_n \pmod x$
I figured out that $X$ will not be greater than smallest number of out numbers. More, if we have two numbers $a$ and $b$, $a and if $a$ divides $b$ without remainder then we can replace those two numbers with just $a$.
I'm sure I'm missing some facts here. Any help appreciated.
Cheers,