AWK, 26 bytes
{for(;$2--;b+=a)a=a$1}$0=b
Try it online!
I had an alternate algorithm I thought might be interesting, but it the code was longer... So this is pretty much a direct translation of the steps in the challenge description.
{for(;$2--; ) }
Fir every line of input, the code runs the loop the number of times given by the second input parameter, the n
value.
a=a$1
The body of the loop appends another copy of the first input parameter to the requested digit, meaning the x
value.
b+=a
At the end of each iteration, the accumulator variable b
is incremented by the current value of the digits placeholder.
$0=b
Finally, once the processing is done, $0=b
overwrites the input line to display the accumulator value.
The only "trick" here is relying on the way AWK will happily treat variables as both strings and integers. Meaning, you can append digits together and still do mathematical operations using the results.