  We consider superconducting nanowire proximity coupled to superconductor /
ferromagnet / superconductor junction, where the magnetization penetrates into
superconducting segment in nanowire decaying as $\sim\exp[-\frac{\mid n
\mid}{\xi}]$ with site index $n$ and the decay length $\xi$. We tune chemical
potential and spin-orbit coupling so that topological superconducting regime
hosting Majorana fermion is realized for long $\xi$. We find that when $\xi$
becomes shorter, zero energy state at the interface between superconductor and
ferromagnet splits into two away from zero energy. Accordingly, the behavior of
Josephson current is drastically changed due to this "zero mode-non-zero mode
crossover". By tuning the model parameters, we find an almost second-harmonic
current-phase relation, $\sin2\varphi$, with phase difference $\varphi$. Based
on the analysis of Andreev bound state (ABS), we clarify that current-phase
relation is determined by coupling of the states within the energy gap. We find
that the emergence of crossing points of ABS is a key ingredient to generate
$\sin2\varphi$ dependence in current-phase relation. We further study both the
energy and $\varphi$ dependence of pair amplitudes in the ferromagnetic region.
For long $\xi$, odd-frequency spin-triplet $s$-wave component is dominant. The
magnitude of the odd-frequency pair amplitude is enhanced at the energy level
of ABS.
