# Compounded interest with threshold

I am trying to solve the following problem:

Shareholders A and B each have 1/2 of 100,000. This 100,000 is subject to a compounded interest of 5%. Shareholder A however decides to withdraw his share of returns up until a threshold of 50,000 after which he stops withdrawing.

This naturally means that A’s share of the overall value after n periods diminishes until the point where he no longer withdraws. Opposite of course for B.

How does one calculate the total value and each shareholders share after n periods?

A = P(1+r/n)^nt would presumably serve as the base of an answer but as may be evident I am a novice when it comes to anything but rather basic math.

$$50000+1,05^n 500000$$
$$\frac{1,05^n 500000}{50000+1,05^n 500000}$$