Confusion in concentration of P type
The resulting concentration is the difference \$N_a -N_d\$.

That's because the one acceptor atom plus one donor atom combine into two neutral atoms.

Since there is only one donor atom for each two acceptors, only half of the acceptors will combine with the donors.

The net result is that \$10^{16}/cm^3\$ will be left uncombined and those determine the resulting concentration.