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 #13 Aug 14 2018 09:01:13
%S 1,2,-2,3,2,-3,4,-2,3,-4,5,2,2,4,-5,6,-2,-3,-2,5,-6,7,2,3,3,2,6,-7,8,
%T -2,2,-4,2,-2,7,-8,9,2,-3,4,4,-3,2,8,-9,10,-2,3,-2,-5,-2,3,-2,9,-10,
%U 11,2,2,3,5,5,3,2,2,10,-11,12,-2,-3,-4,2,-6,2,-4,-3,-2,11,-12,13,2,3,4,2,6,6,2
%N Triangle T(n, k): T(n, 1) = n, T(n, n) = -n if n>1, T(n, k+n) = T(n, k) if n>1.
%C The function T(n, k) = T(k, n) is defined for k>n but only the values for 1 <= k <= n as a triangular array are listed here.
%H G. C. Greubel, <a href="/A193212/b193212.txt">Rows n=1..100 of triangle, flattened</a>
%F T(n, k) = - gcd(n, k) if gcd(n, k) > 1.
%e {1}, {2, -2}, {3, 2, -3}, {4, -2, 3, -4}, {5, 2, 2, 4, -5}, {6, -2, -3, -2 ,5, -6}, ...
%t T[ n_, k_] := If[ n < 1 || k < 1, 0, If[ k > n, T[ k, n], If[ k == 1, n, If[ n > k, T[ k, Mod[ n, k, 1]], -n]]]]
%o (PARI) {T(n, k) = if( n<1 || k<1, 0, if( k>n, T(k, n), if( k==1, n, if( n>k, T(k, (n-1)%k + 1), -n))))}
%Y Cf. A054521.
%K sign,tabl
%O 1,2
%A _Michael Somos_, Jul 18 2011