OFFSET
1,2
COMMENTS
The sequence is a permutation of all integers >= 0.
Each row of T contains n*2-1 terms; the terms in column k increase by 2^k.
T(1,1) = 0; T(2,2) = 3.
T(2,1) = T(1,1)+2 = 2; T(2,3) = 4*T(1,1)+1 = 1 ("knight jump").
In the context of the 3x+1 problem, when a term x is used to represent the odd 4*x+1, its successor is 3*x+1, and k-1 is the 2-adic valuation of 3*x+1.
Right diagonal is A002450.
The terms at the top of the columns are A096773(k), or (2^(k-1)*(3 + 2*(-1)^k) - 1)/3.
When the table is analytically continued upwards by subtracting 2^k, the first layer of values are -A255138(k), or -(2^k*(3 + 2*(-1)^k) + 1)/3.
FORMULA
For n>1, T(n,k) = T(n-1,k) + 2^k, so T(n,1) = 2*(n-1).
T(n,2) = 4*(n-1)-1 = 2*T(n,1)-1, so T(2,2) = 3.
For n>1 and k>2, T(n,k) = 4*T(n-1,k-2)+1, so T(2,3) = 1.
For i>=0, a(i^2+1) = T(i+1,1).
T(n, k) = 2^k * (n - (6*k + 3 - (-1)^k)/12) - 1/3.
T(n,1) == 0 (mod 2); T(n,2) == 3 (mod 4); T(n,k>=3) == 1 (mod 4).
k = v2(3*T(n,k)+1) + 1, where v2(x) = A007814(x) is the 2-adic valuation of x.
EXAMPLE
Triangle T(n,k) begins:
n/k 1| 2| 3| 4| 5| 6| 7| 8| 9| 10| 11|
1| 0
2| 2 3 1
3| 4 7 9 13 5
4| 6 11 17 29 37 53 21
5| 8 15 25 45 69 117 149 213 85
6| 10 19 33 61 101 181 277 469 597 853 341
7| 12 ...
PROG
(PARI) my(N=8, v=Vec([0, 2, 3, 1], N^2), p=4); for(n=3, N, my(K=2*n-1); for(k=1, K, v[p+k]=if(k<=2, v[p-K+k+2]+2^k, 4*v[p-K+k]+1)); p+=K); v
(PARI) T(n, k) = 2^k*(n-(6*k+3-(-1)^k)/12)-1/3;
(PARI) n_of_x(x) = my(n=0); while(1==x%4, x>>=2; n++); n + if(x%2, (x+1)/4, x/2) + 1;
(PARI) k_of_x(x) = valuation(3*x+1, 2) + 1;
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Ruud H.G. van Tol, Jul 29 2023
STATUS
approved