Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #19 Mar 27 2023 12:44:59
%S 1,1,0,1,1,0,1,-1,1,0,1,1,1,0,0,1,-2,-1,1,1,0,1,1,2,1,-1,0,0,1,-3,1,
%T -1,1,0,1,0,1,1,-2,-1,1,1,1,0,0,1,-4,3,2,-1,1,-1,-1,1,0,1,1,1,1,3,1,
%U -2,0,0,0,0,1,-5,-3,-2,-3,-1,1,2,1,1,1,0,1,1,4,-2,2,-1,1,1,-1,1,-1,0,0
%N Table read by upward antidiagonals: Given m, n >= 1, write gcd(m,n) as d = u*m+v*n where u, v are minimal; T(m,n) = v.
%C The gcd is given in A003989, and u is given in A345415. Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when m=n. If we ignore the diagonal, the v table is the transpose of the u table.
%e The gcd table (A003989) begins:
%e [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
%e [1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]
%e [1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1]
%e [1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4]
%e [1, 1, 1, 1, 5, 1, 1, 1, 1, 5, 1, 1, 1, 1, 5, 1]
%e [1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2]
%e [1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 7, 1, 1]
%e [1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, 8]
%e [1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1]
%e [1, 2, 1, 2, 5, 2, 1, 2, 1, 10, 1, 2, 1, 2, 5, 2]
%e [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1]
%e [1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 1, 12, 1, 2, 3, 4]
%e ...
%e The u table (A345415) begins:
%e [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
%e [0, 0, -1, 1, -2, 1, -3, 1, -4, 1, -5, 1, -6, 1, -7, 1]
%e [0, 1, 0, -1, 2, 1, -2, 3, 1, -3, 4, 1, -4, 5, 1, -5]
%e [0, 0, 1, 0, -1, -1, 2, 1, -2, -2, 3, 1, -3, -3, 4, 1]
%e [0, 1, -1, 1, 0, -1, 3, -3, 2, 1, -2, 5, -5, 3, 1, -3]
%e [0, 0, 0, 1, 1, 0, -1, -1, -1, 2, 2, 1, -2, -2, -2, 3]
%e [0, 1, 1, -1, -2, 1, 0, -1, 4, 3, -3, -5, 2, 1, -2, 7]
%e [0, 0, -1, 0, 2, 1, 1, 0, -1, -1, -4, -1, 5, 2, 2, 1]
%e [0, 1, 0, 1, -1, 1, -3, 1, 0, -1, 5, -1, 3, -3, 2, -7]
%e [0, 0, 1, 1, 0, -1, -2, 1, 1, 0, -1, -1, 4, 3, -1, -3]
%e [0, 1, -1, -1, 1, -1, 2, 3, -4, 1, 0, -1, 6, -5, -4, 3]
%e [0, 0, 0, 0, -2, 0, 3, 1, 1, 1, 1, 0, -1, -1, -1, -1]
%e ...
%e The v table (this entry) begins:
%e [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
%e [1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]
%e [1, -1, 1, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1]
%e [1, 1, -1, 1, 1, 1, -1, 0, 1, 1, -1, 0, 1, 1, -1, 0]
%e [1, -2, 2, -1, 1, 1, -2, 2, -1, 0, 1, -2, 2, -1, 0, 1]
%e [1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 0, 1, 1, 1, -1]
%e [1, -3, -2, 2, 3, -1, 1, 1, -3, -2, 2, 3, -1, 0, 1, -3]
%e [1, 1, 3, 1, -3, -1, -1, 1, 1, 1, 3, 1, -3, -1, -1, 0]
%e [1, -4, 1, -2, 2, -1, 4, -1, 1, 1, -4, 1, -2, 2, -1, 4]
%e [1, 1, -3, -2, 1, 2, 3, -1, -1, 1, 1, 1, -3, -2, 1, 2]
%e [1, -5, 4, 3, -2, 2, -3, -4, 5, -1, 1, 1, -5, 4, 3, -2]
%e [1, 1, 1, 1, 5, 1, -5, -1, -1, -1, -1, 1, 1, 1, 1, 1]
%e ...
%p mygcd:=proc(a,b) local d,s,t; d := igcdex(a,b,`s`,`t`); [a,b,d,s,t]; end;
%p gcd_rowv:=(m,M)->[seq(mygcd(m,n)[5],n=1..M)];
%p for m from 1 to 12 do lprint(gcd_rowv(m,16)); od;
%t T[m_, n_] := Module[{u, v}, MinimalBy[{u, v} /. Solve[u^2 + v^2 <= 26 && u*m + v*n == GCD[m, n], {u, v}, Integers], #.#&][[1, 2]]];
%t Table[T[m - n + 1, n], {m, 1, 13}, {n, 1, m}] // Flatten (* _Jean-François Alcover_, Mar 27 2023 *)
%Y Cf. A003989, A050873, A345415, A345417, A345418.
%K sign,tabl
%O 1,17
%A _N. J. A. Sloane_, Jun 19 2021