Suppose that $ m\equiv 1\mod 4 $ is a prime and that $ n\equiv 3\mod 4 $ is a primitive root modulo $ m $. In this paper we obtain a relation between the class number of the imaginary quadratic field $ \mathbb{Q}(\sqrt{-nm}) $ and the digits of the base $ n $ expansion of $ 1/m $. Furthermore, we obtain corollaries connecting the $ 3 $ rank of the class number of the real quadratic field $ \mathbb{Q}(\sqrt{m}) $ to the $ 3 $ divisibility of the number of certain quadratic residues modulo $ m $. Secondly, we study some convoluted sums involving the base $ n $ digits of $ 1/m $ and arrive at certain distribution results of $ m $ modulo any prime $ p $ that properly divides $ n+1 $. Our result implies that the primes $ m $ for which $ n $ is a primitive root belong to one of two equivalence classes modulo any prime $ p $ as above.