Magnetohydrodynamic equilibrium states with a three-dimensional helical core are computed to model the MAST spherical tokamak and the RFX-mod reversed field pinch. The boundary is fixed as axisymmetric. The MAST equilibrium state has the appearance of an internal kink mode and is obtained under conditions of weak reversed central shear. The RFX-mod equilibrium state has seven-fold periodicity. An ideal magnetohydrodynamic stability analysis reveals that the reversal of the core magnetic shear can stabilize a periodicity-breaking mode that is dominantly m/n = 1/8 strongly coupled to a m/n = 2/15 component, as long as the central rotational transform does not exceed the value of 8.