The sequence (xn)n∈N = (2, 5, 15, 51, 187, . . .) given by the rule xn = (2 n + 1)(2n−1 + 1)/3 appears in several seemingly unrelated areas of mathematics. For example, xn is the density of a language of words of length n with four different letters. It is also the cardinality of the quotient of (Z2×Z2) under the left action of the special linear group SL(2,Z). In this paper we show how these two interpretations of xn are related to each other. More generally, for prime numbers p we show a correspondence between a quotient of Zp × Zp and a language with p2 letters and words of length n. Mathematics Subject Classifications: 37F20, 57Q20, 05E15, 68R15