The formula for the Gordon growth model is:
$\hspace{1in}P= \sum_{t=1}^{\infty} D\times\frac{(1+g)^t}{(1+k)^t}$
So summing the infinite series we get:
$\hspace{1in}P=\frac{D(1+g)}{k-g} \hspace{2in}\mbox{(1)}$
Here's my attempt to arrive at equation (1):
The sum of a geometric series is:
$\hspace{1in}\frac{a}{1-r}$
So, plugging in the values:
$\hspace{1in}\frac{D}{1-\frac{1+g}{1+k}}$
$\hspace{1in}\frac{D}{\frac{1+k-(1+g)}{1+k}}$
$\hspace{1in}\frac{D}{\frac{k-g}{1+k}}$
Therefore,
$\hspace{1in}P=\frac{D(1+k)}{1+g}$
Appreciate if someone could highlight where I made a mistake.
Thanks you.
The question was basically answered already in comments. I'll add some details so that the question does not remain unanswered.
In the formula $\frac{a}{1-r}$ you should have used $$a=D\frac{1+g}{1+k} \text{ and }r=\frac{1+g}{1+k}.$$ (You have used $a=D$.)
With this change, using the same as you posted in your question, you will arrive to $$\frac a{1-r} = D\frac{1+g}{1+k} \frac1{1-\frac{1+g}{1+k}} = D\frac{1+g}{1+k} \frac1{\frac{k-g}{1+k}} = D\frac{1+g}{k-g}.$$