login
A355090
Square array A(n, k), n >= 0, k > 0, read by antidiagonals upwards; A(n, k) is the unique m such that n/k = fusc(m)/fusc(m+1) (where fusc is Stern's diatomic series A002487).
3
0, 1, 0, 3, 2, 0, 7, 1, 4, 0, 15, 5, 6, 8, 0, 31, 3, 1, 2, 16, 0, 63, 11, 9, 14, 12, 32, 0, 127, 7, 13, 1, 10, 4, 64, 0, 255, 23, 3, 17, 30, 2, 24, 128, 0, 511, 15, 19, 5, 1, 6, 28, 8, 256, 0, 1023, 47, 27, 29, 33, 62, 18, 20, 48, 512, 0, 2047, 31, 7, 3, 25, 1, 22, 2, 4, 16, 1024, 0
OFFSET
0,4
COMMENTS
The binary expansion of A(n, k) encodes the position of n/k (> 0) in the Calkin-Wilf tree.
FORMULA
A(m*n, m*k) = A(n, k) for any m > 0.
A(k, n) = A054429(A(n, k)) for any n, k > 0.
A(0, k) = 0.
A(1, k) = 2^(k-1).
A(n, 1) = 2^n - 1.
A(n, n+1) = A000918(n+1).
A(A002487(n), A002487(n+1)) = n.
EXAMPLE
Square array A(n, k) begins:
n\k| 1 2 3 4 5 6 7 8 9 10 11 12
---+-----------------------------------------------------------------
0| 0 0 0 0 0 0 0 0 0 0 0 0
1| 1 2 4 8 16 32 64 128 256 512 1024 2048
2| 3 1 6 2 12 4 24 8 48 16 96 32
3| 7 5 1 14 10 2 28 20 4 56 40 8
4| 15 3 9 1 30 6 18 2 60 12 36 4
5| 31 11 13 17 1 62 22 26 34 2 124 44
6| 63 7 3 5 33 1 126 14 6 10 66 2
7| 127 23 19 29 25 65 1 254 46 38 58 50
8| 255 15 27 3 21 9 129 1 510 30 54 6
9| 511 47 7 35 61 5 49 257 1 1022 94 14
10| 1023 31 39 11 3 13 57 17 513 1 2046 62
11| 2047 95 55 59 67 125 37 41 97 1025 1 4094
12| 4095 63 15 7 51 3 45 5 9 33 2049 1
PROG
(PARI) A(x, y) = { if (x==0, 0, my (v=0, t=1, a=0, b=1, c=1, d=0); while (1, my (m=a+c, n=b+d); if (x*n==y*m, return (t+v), x*n<y*m, [c, d]=[m, n], [v, a, b]=[v+t, m, n]); t*=2)) }
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Rémy Sigrist, Jun 18 2022
STATUS
approved