OFFSET
0,4
COMMENTS
The function d is a bijection from the nonnegative integers to the nonnegative dyadic rationals satisfying d(A000695(n)) = n for any n >= 0.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..10010
Rémy Sigrist, Colored representation of the table for n, k < 2^10 (where the hue is function of T(n, k))
Wikipedia, Dyadic rational
FORMULA
EXAMPLE
Array T(n, k) begins:
n\k| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
---- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
0| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1| 1 4 3 6 5 16 7 18 9 12 11 14 13 24 15 26
2| 2 3 1 4 6 7 5 16 10 11 9 12 14 15 13 24
3| 3 6 4 5 7 18 16 17 11 14 12 13 15 26 24 25
4| 4 5 6 7 16 17 18 19 12 13 14 15 24 25 26 27
5| 5 16 7 18 17 20 19 22 13 24 15 26 25 28 27 30
6| 6 7 5 16 18 19 17 20 14 15 13 24 26 27 25 28
7| 7 18 16 17 19 22 20 21 15 26 24 25 27 30 28 29
8| 8 9 10 11 12 13 14 15 2 3 1 4 6 7 5 16
9| 9 12 11 14 13 24 15 26 3 6 4 5 7 18 16 17
10| 10 11 9 12 14 15 13 24 1 4 3 6 5 16 7 18
PROG
(PARI) d(n) = { my (v=0, k); while (n, n-=2^k=valuation(n, 2); v+=2^((-1)^k*(k+1)\2)); v }
t(n) = { my (v=0, k); while (n, n-=2^k=valuation(n, 2); v+=2^if (k>=0, 2*k, -1-2*k)); v }
T(n, k) = t(d(n)+d(k))
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Feb 19 2022
STATUS
approved