First-principle investigations of n doping in LiFePO4