I'm trying to make an exercise which gets a list of numers, an shows a list of elements like this: if A=[a0,a1,a2] then there is U=[u0,u1,u2], knowing that a0*u0 + a1*u1 + a2*u2 = d and d is the gcd of A.
For 2 elements is a pretty simple thing, as Sage has a function to retrieve u0 and u1 out of a0 and a1:
A=[15,21]
(d,u0,u1)=xgcd(a[0],a[1])
I just don't understand how could I do this with a list of n elements.