OFFSET
0,8
COMMENTS
For any n >= 0 and k >= 0:
- let r_n be the lengths of runs in binary expansion of n,
- for n = 0: we assume that r_0 = (),
- when n > 0: let R_n be the #r_n-periodic sequence whose first #r_n terms match r_n,
- r_{T(n, k)} has lcm(#r_n, #r_k) terms and r_{T(n, k)}(i) = R_n(i) * R_k(i) for i = 1..lcm(#r_n, #r_k).
FORMULA
For any m >= 0, n >= 0 and k >= 0:
- T(n, k) = T(k, n) (T is commutative),
- T(m, T(n, k)) = T(T(m, n), k) (T is associative),
- T(n, 0) = 0 (0 is an absorbing element for T),
- T(n, 1) = n (1 is an neutral element for T),
- T(n, 3) = A001196(n),
- T(n, 7) = A097254(n+1),
- T(n, 15) = A097262(n),
- T(n, n) = A322149(n),
- T(2^n - 1, 2^k - 1) = 2^(n*k) - 1.
- T(2^n, 2^k) = 2^(n*k) when n > 0 and k > 0,
- T(n, k) is odd iff both n and k are odd.
EXAMPLE
Array T(n, k) begins (in decimal):
n\k| 0 1 2 3 4 5 6 7 8 9 10
---+--------------------------------------------------------
0| 0 0 0 0 0 0 0 0 0 0 0
1| 0 1 2 3 4 5 6 7 8 9 10
2| 0 2 2 12 4 42 6 56 8 150 10
3| 0 3 12 15 48 51 60 63 192 195 204
4| 0 4 4 48 16 292 12 448 64 2124 36
5| 0 5 42 51 292 5 438 455 2184 9 2730
6| 0 6 6 60 12 438 30 504 24 3294 54
7| 0 7 56 63 448 455 504 511 3584 3591 3640
8| 0 8 8 192 64 2184 24 3584 512 33048 136
Array T(n, k) begins (in binary):
n\k| 0 1 10 11 100 101 110
----+---------------------------------------------------------------
0| 0 0 0 0 0 0 0
1| 0 1 10 11 100 101 110
10| 0 10 10 1100 100 101010 110
11| 0 11 1100 1111 110000 110011 111100
100| 0 100 100 110000 10000 100100100 1100
101| 0 101 101010 110011 100100100 101 110110110
110| 0 110 110 111100 1100 110110110 11110
111| 0 111 111000 111111 111000000 111000111 111111000
1000| 0 1000 1000 11000000 1000000 100010001000 11000
PROG
(PARI) T(n, k) = my (v=0, p=1, rn=n, rk=k, b=if ((max(n, 1)%2)&&(max(k, 1)%2), 1, 0)); while (1, my (vn=if (rn==0, 0, valuation(rn+(rn%2), 2)), vk=if
(rk==0, 0, valuation(rk+(rk%2), 2)), w=vn*vk); v+=b*p*(2^w-1); rn\=2^vn; rk\=2^vk; if (rn==0 && rk==0, return (v), rn==0, rn=n, rk==0, rk=k); p*=2^w; b=1-b)
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Dec 06 2018
STATUS
approved