The Minkowski question mark function ?(x) arises as a real distribution of rationals in the Farey tree. We examine the generating function of moments of ?(x). It appears that the generating function is a direct dyadic analogue of period functions for Maass wave forms and it is defined in the cut plane \ (1, ∞). The exponential generating function satisfies an integral equation with kernel being the Bessel function. The solution of this integral equation leads to the definition of dyadic eigenfunctions, arising from a certain Hilbert–Schmidt operator. Finally, we describe p-adic distribution of rationals in the Stern–Brocot tree. Surprisingly, the Eisenstein series G2(z) does manifest in both real and p-adic cases.