Arithmetic functions related to number representation systems exhibit
various periodicity phenomena. For instance, a well-known theorem of D
elange expresses the total number of ones in the binary representation
s of the first n integers in terms of a periodic fractal function. We
show that such periodicity phenomena can be analyzed rather systematic
ally using classical tools from analytic number theory, namely the Mel
lin-Perron formulae. This approach yields naturally the Fourier series
involved in the expansions of a variety of digital sums related to nu
mber representation systems.