  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. In this work, we extend this result by
introducing a weighted analog of $s(n)$, deriving a variant of the
Trollope-Delange formula for this generalization.
