well greg did two steps together ...
multiply by n(1-k) to get k^2 = 2pn(1-k)
then subtract the right hand side to get k^2+2pnk-2pn = 0
solution of quadratic k = -b+-sqrt(b^2-4ac)/2a ... k = -2pn+-sqrt((2pn)^2-4(-2pn))/2
k = -pn+-sqrt(4((pn)^2+2pn))/2
k = -pn+sqrt((pn)^2+2pn) ... the "-" gets an unreal -ve solution
that's nearly what you've written, with some "tolerance" on where the brackets are ...
another day in paradise, or is paradise one day closer ?