Exact equilibrium solutions for nonlinear spatial deformations of nanorods with application to buckling under terminal force and couple