  For an integer b>=2, let s_b(n) be the sum of the digits of the integer n
when written in base b, and let S_b(N) be the sum of s_b(n) over n=0,...,N-1,
so that S_b(N) is the sum of all b-ary digits needed to write the numbers
0,1,...,N-1. Several inequalities are derived for S_b(N). Some of the
inequalities can be interpreted as comparing the average value of s_b(n) over
integer intervals of certain lengths to the average value of a beginning
subinterval. Two of the main results are applied to derive a pair of
"approximate convexity" inequalities for a sequence of Takagi-like functions.
One of these inequalities was discovered recently via a different method by V.
Lev; the other is new.
