When I started blogging I was reluctant to allow comments. It seems this would open the door to a flood of spam. Indeed it does, but nearly all of it can be filtered out automatically.

The comments that aren’t spam have generally been high quality. A comment on my post about the sawtooth function a few days ago has sent me down a fascinating rabbit hole.The sawtooth function belongs to a general class of functions called replicative functions, functions that satisfy the equation

for positive integers *n*.

I ran across this by reading Knuth’s TAOCP. Knuth gives an understated comment in section 1.2.4 exercise 40 that “it may be interesting to study also the more general class of functions” for which the left-hand side above includes constants that depend on *n*, i.e.

where the constants *a*_{n} and *b*_{n} depend on *n* but not on *x*.

## Bernoulli polynomials

The first Bernoulli polynomial *B*_{1}(*x*) = *x* − ½ is a replicative function, and the only continuous replicative functions are multiples of *B*_{1} (proved in exercise 40 referenced above).

The rest of the Bernoulli polynomials *B _{m}*(

*x*) are generalized replicative functions, with

*a*

_{n}=

*n*

^{m−1}and

*b*

_{n}= 0. This was discovered by Joseph Raabe in the nineteenth century.

## Gamma and digamma functions

Gauss’s multiplication theorem for the gamma function says that for positive *n*,

This is equation 6.1.20 in A&S. If we take logs of both sides, we find that log Γ is a **almost** a generalized replicative function.

The factor of *n* log(*n*) *z* prevents the definition from holding, but if we take derivatives, this term goes away.

This means that the derivative of log Γ, a.k.a the ψ function, a.k.a. the digamma function, is a generalized replicative function with *a*_{n} = *n* and *b*_{n} = −*n* log *n*.

The derivative of a generalized replicative function is another function in the same class, so the higher derivatives of log Γ, known as the polygamma functions, are also generalized replicative functions.

## Hurwitz zeta function

The Hurwitz zeta function ζ(*s*, *z*) is defined by

The Riemann zeta function is the special case of the Hurwitz zeta function with *z* = 1.

The Hurwitz zeta function is related to the polygamma functions by

It follows from this that for fixed *s*, ζ(*s*, *z*) is a generalized replicative function of *z*. You can show that *a*_{n} = *n*^{s} and *b*_{n} = 0.

## Trig functions

See the next post for a couple examples involving trig functions: cot π*x* and csc² π*x* .

There is an interesting extension of this whereby an integer multiple m is applied such that the sum runs over m*i/n and the left hand side becomes a function of the gcd(n, m). It means any replicative function can actually be used as an explicit means of calculating the gcd.