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..8191
Wikipedia, Dyadic rational
FORMULA
EXAMPLE
PROG
(PARI) a(n) = { my (d=0, k); while (n, n-=2^k=valuation(n, 2); d+=2^((-1)^k*(k+1)\2)); numerator(d) }
CROSSREFS
KEYWORD
nonn,base,frac
AUTHOR
Rémy Sigrist, Feb 16 2022
STATUS
approved