OFFSET
1,14
COMMENTS
Entry A(n, k) at row n and column k tells how many bits needs to be flipped in the binary expansion of the (n-1)-th iterate of Reduced Collatz function R, when started from 2*k-1, to obtain the unique term of A086893 with the same binary length as that (n-1)-th iterate. That is, A(n, k) gives the Hamming distance between A372283(n, k) and A086893(1+A000523(A372283(n, k))).
Zeros occur in the same locations as where they occur in A372359, etc.
FORMULA
EXAMPLE
Array begins:
n\k| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
---+-------------------------------------------------------------------------
1 | 0, 0, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 2, 3, 1, 2, 2, 3, 1, 2, 3, 4, 2, 3,
2 | 0, 0, 0, 2, 1, 1, 0, 1, 0, 1, 0, 3, 2, 3, 2, 3, 2, 0, 1, 3, 2, 2, 1, 2,
3 | 0, 0, 0, 1, 2, 0, 0, 3, 0, 2, 0, 0, 1, 2, 1, 2, 2, 0, 2, 2, 3, 1, 0, 5,
4 | 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 2, 3, 0, 5, 1, 0, 1, 3, 2, 1, 0, 4,
5 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 4, 2, 0, 0, 2, 5, 1, 0, 3,
6 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 3, 1, 0, 0, 2, 4, 2, 0, 3,
7 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 3, 0, 0, 0, 1, 3, 1, 0, 4,
8 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 4, 0, 0, 0, 2, 3, 0, 0, 3,
9 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 0, 1, 4, 0, 0, 4,
10 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 3, 0, 0, 4,
11 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 4, 0, 0, 0, 0, 4, 0, 0, 5,
12 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 5, 0, 0, 0, 0, 4, 0, 0, 3,
13 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 3, 0, 0, 0, 0, 5, 0, 0, 6,
14 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 6, 0, 0, 0, 0, 3, 0, 0, 2,
15 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 2, 0, 0, 0, 0, 6, 0, 0, 4,
16 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 0, 0, 0, 0, 2, 0, 0, 4,
17 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 0, 0, 0, 0, 4, 0, 0, 4,
18 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 4, 0, 0, 3,
19 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 3, 0, 0, 0, 0, 4, 0, 0, 4,
20 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 3, 0, 0, 6,
21 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 6, 0, 0, 0, 0, 4, 0, 0, 4,
We have A372283(5, 14) = 71, and when we compare the binary expansion of 71 = 1000111_2 with the term of A086893 that has a binary expansion of the same length, which in this case is 85 = 1010101_2, we see that only the bits at positions 1 and 4 (indexed from the right hand end, with 0 being the least significant bit position at right) need to be toggled to obtain the 71 from 85 or vice versa, therefore A(5, 14) = 2.
PROG
(PARI)
up_to = 105;
R(n) = { n = 1+3*n; n>>valuation(n, 2); };
A372283sq(n, k) = if(1==n, 2*k-1, R(A372283sq(n-1, k)));
A000523(n) = logint(n, 2);
A086893(n) = (if(n%2, 2^(n+1), 2^(n+1)+2^(n-1))\3);
A372361sq(n, k) = A372358(A372283sq(n, k));
A372361list(up_to) = { my(v = vector(up_to), i=0); for(a=1, oo, for(col=1, a, i++; if(i > up_to, return(v)); v[i] = A372361sq((a-(col-1)), col))); (v); };
v372361 = A372361list(up_to);
A372361(n) = v372361[n];
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, May 01 2024
STATUS
approved