OFFSET
1,2
COMMENTS
The sequence is a permutation of all integers >= 0.
Each row of T contains n*2-1 terms.
T(1,1) = 0; T(2,1) = T(1,1)+3; T(2,2) = T(2,1)-1; T(2,3) = 3*T(1,1)+1 = 1 ("knight jump").
Right diagonal is A003462.
The first two columns increase by 3^1, the next two columns by 3^2, and so on.
FORMULA
T(n,k) = ((12*n - 6*k - 3 + (-1)^k)/2 * 3^((2*k - 3 - (-1)^k)/4) - 1)/2.
T(n,k) = T(n-1,k) + 3^ceil(k/2).
EXAMPLE
Triangle T(n,k) begins:
n/k 1| 2| 3| 4| 5| 6| 7| 8| 9|
1| 0
2| 3 2 1
3| 6 5 10 7 4
4| 9 8 19 16 31 22 13
5| 12 11 28 25 58 49 94 67 40
6| 15 ...
PROG
(PARI) { local( T(n, k) = if(k<=2, 3*(n-1)+1-k, 3*T(n-1, k-2)+1) ); for(n=1, 8, for(k=1, 2*n-1, print1(T(n, k), ", ")); print); }
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Ruud H.G. van Tol, Sep 19 2023
STATUS
approved