Given a range $a_1, a_2, ...., a_n$ and given values $x = GCD( a_1, a_2, ....., a_i)$ and $y = GCD(a_1, a_2, a_3, ...., a_j)$ where $i < j$
Is it possible to then find the value of $GCD(a_i, ..... a_j)$ with just the information provided?
To provide context, I'm trying to see how a Fenwick tree can be modified to handle ranged GCD queries. The obvious answer here is that $y = GCD(x, a_{i+1}, a_{i+2}, ....... a_j)$ However, I don't see how I can query this without iterating through all the values of a from i+1 to j and not use a Fenwick Tree's $O(log n)$ retrieval. As far as I understand, I can't solve this unless the operator has an inverse (querying sum in a range is easy as the inverse of addition is subtraction). Any ideas on how the above is solvable?