Let \(n\ge 1\) be an integer, let \(p\ge 5\) be a prime number, let \(1<g<p\) be a primitive root modulo p, and let F denote either the quadratic field \(\mathbb {Q}(\sqrt{p})\) in the case n is even and \(p\equiv 1 \pmod {4}\) , or \(\mathbb {Q}(\sqrt{-p})\) in the case n is odd and \(p\equiv 3 \pmod {4}\) . For \(n=1\) , the class number of the field F is expressed in terms of the alternating sum of the digits of the repetend in the g-adic expansion of 1/p in Girstmair (Am Math Mon 101(10):997–1001, 1994; Acta Arith 67(4):381–386, 1994), and Murty and Thangadurai (Proc Amer Math Soc 139(4):1277–1289, 2011). In this paper, the orders of even algebraic K-groups \(K_{2n-2}(\mathcal {O}_F)\) , for the ring of integers \(\mathcal {O}_F\) of F, are expressed in terms of the digits of the repetend of the g-adic expansion of 1/p for any integer \(n\ge 2\) .