Let $s(n)$ denote the number of "$1$"s in the dyadic representation of a positive integer $n$ and sequence $S(n) = s(1)+s(2)+\dots+s(n-1)$. The Trollope-Delange formula is a classic result that represents the sequence $S$ in terms of the Takagi function. This work extends the result by introducing a $q$-weighted analog of $s(n)$, deriving a variant of the Trollope-Delange formula for this generalization. We show that for $1/2<|q|< 1$, nondifferentiable Takagi-Landsberg functions appear, whereas for $|q|>1$, the resulting functions are differentiable almost everywhere. We further show how the result can be used to find limiting curves describing fluctuations in the ergodic theorem for the dyadic odometer.
Categories: math.NT math.DS