add get N prime function