The nitrogen edge-doped effect on the structure, dipole moment, and first hyperpolarizability of the supershort single-walled carbon nanotube (5, 0) has been studied systematically.