OFFSET
1,2
COMMENTS
The function T(n, k) = T(k, n) is defined for k > n also but only the values for 1 <= k <= n as a triangular array are listed here.
LINKS
M. Granvik, Is this a recurrence for the Mertens function plus 2?, Math StackExchange question 50719.
EXAMPLE
Triangle begins:
1;
2, -2;
1, 2, -3;
1, -2, 1, 0;
0, 2, 2, 1, -5;
1, -2, -3, -2, 0, 6;
...
MATHEMATICA
T[ n_, k_] := Which[ n < 1 || k < 1, 0, k > n, T[ k, n], k == 1, If[ n < 3, n, (n T[ n - 1, 1] - Sum[ T[ n, i], {i, 2, n - 1}]) / (n + 1)], n > k , T[ k, Mod[ n, k, 1]], True, - Sum[ T[ n, i], {i, n - 1}]];
PROG
(PARI) {T(n, k) = if( n<1 || k<1, 0, k>n, T(k, n), k==1, if( n<3, n, (n * T(n-1, 1) - sum( i=2, n-1, T(n, i))) / (n+1)), n>k, T(k, (n-1)%k+1), -sum( i=1, n-1, T(n, i)))};
CROSSREFS
KEYWORD
sign,tabl
AUTHOR
Michael Somos, Oct 07 2017
STATUS
approved