Minimum doping densities for p–n junctions