OFFSET
0,3
COMMENTS
To build the binary expansion of a(n):
- start with n indeterminate digits,
- while there are some, say m, indeterminate digits,
replace the first of them with the binary expansion of m.
The binary plot of the sequence has locally periodic patterns.
LINKS
FORMULA
A070939(a(n)) = n for any n > 0.
EXAMPLE
For n = 10:
- the binary expansion of a(10) has 10 digits, and is the concatenation of:
- the binary expansion of 10 which is "1010",
- the binary expansion of 10 - 4 = 6 which is "110",
- the binary expansion of 10 - 4 - 3 = 3 which is "11",
- the binary expansion of 10 - 4 - 3 - 2 = 1 which is "1",
- as 10 = 4 + 3 + 2 + 1, we stop here,
- so the binary expansion of a(10) is "1010110111",
- and a(10) = 695.
PROG
(PARI) a(n) = { if (n==0, 0, my (k=n-#binary(n)); n*2^k+a(k)) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, May 05 2021
STATUS
approved