First consider $S_n = 1 + 11 + 111 + 1111 + \cdots$ to $n$ terms. Each individual term can be written and summed as a geometric series, for example $$1111 = 1 + 10 + 100 + 1000 = \frac{10^4-1}{10 - 1}$$ Hence $$S_n= \frac{10^1 - 1}{9} + \frac{10^2 - 1}{9} + \frac{10^3 - 1}{9} + \frac{10^4 - 1}{9} + ... + \frac{10^n - 1}{9}$$ $$= \frac{10 + 10^2 + 10^3 + 10^4 + ... +10^n }{9} - \frac{n}{9}$$ $$= \frac{10^{n+1}- 10}{81} - \frac{n}{9}$$ $$= \frac{10^{n+1}- 10 - 9n}{81}$$ So $6 + 66 + 666 + 6666 \cdots$ to $n$ terms is: $$6( 1 + 11 + 111 + 1111 + ... ) = \frac{2}{3}\Big[ \frac{10(10^n - 1)}{9}- n \Big]$$