Maybe you want ezgcd:

(%i1) ezgcd(2,6,12);
(%o1) [2,1,3,6]