OFFSET
0,3
COMMENTS
For any nonnegative integer n:
- the binary expansion of n can be uniquely expressed as the concatenation of k = A069010(n) positive terms of A023758 separated by 0's:
(where | denotes binary concatenation)
- a(n) = ( Sum_{i = 1..k} 2^Sum_{j = 1..i} m_j ) / 2.
This sequence is a permutation of the nonnegative integers, with inverse A352783.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..8192
Rémy Sigrist, Colored logarithmic scatterplot of the first 2^20 terms (where the color is function of A069010(n))
FORMULA
EXAMPLE
PROG
(PARI) a(n) = { my (v=0, s=-1, z, o, i); while (n, n\=2^z=valuation(n, 2); n\=2^o=valuation(n+1, 2); n\=2; i=(o+z)*(o+z-1)/2 + o; v+=2^s+=i); v }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Apr 02 2022
STATUS
approved