Base-d Expansions with Digits 0 to q − 1

Let d and q be positive integers, and consider representing a positive integer n in base d and digits 0, 1, … , q − 1. If q < d, then not all positive integers can be represented. If q = d, then every positive integer can be represented in exactly one way. If q > d, then there may be multiple ways of representing an integer n. Let fd, q(n) be the number of representations of n in base d and digits 0, 1, … , q − 1. In this paper, we will look at the asymptotics of fd, q(n) as n → ∞. They depend in a rather strange way on the generalized Thue–Morse sequence.