login

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”).

A193212
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.
1
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, -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, 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
OFFSET
1,2
COMMENTS
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.
FORMULA
T(n, k) = - gcd(n, k) if gcd(n, k) > 1.
EXAMPLE
{1}, {2, -2}, {3, 2, -3}, {4, -2, 3, -4}, {5, 2, 2, 4, -5}, {6, -2, -3, -2 ,5, -6}, ...
MATHEMATICA
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]]]]
PROG
(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))))}
CROSSREFS
Cf. A054521.
Sequence in context: A336346 A338283 A104324 * A131818 A222111 A222438
KEYWORD
sign,tabl
AUTHOR
Michael Somos, Jul 18 2011
STATUS
approved