The two cosets of are clopen sets in the 2-adic integers. The function is constant on each, so it is a locally constant function and therefore continuous. Its values on the nonnegative integers are .
The Mahler coefficient at index is the nth forward difference operator applied at zero. Here
Thus the Mahler expansion of the parity function is
To verify the expansion directly, each binomial polynomial takes values in : it does so at nonnegative integers, which form a dense subset, and polynomial evaluation is continuous into . Hence the nth summand has 2-adic absolute value at most throughout the domain. The ultrametric inequality proves uniform convergence, and the sum is continuous. At each nonnegative integer , the series becomes the finite binomial theorem identity . Equality on a dense subset and continuity prove equality everywhere. Finally, the coefficients in any such expansion are determined successively by its values at , since for and . This also verifies uniqueness without needing the general Mahler theorem.