We consider a one-dimensional
p-wave superconducting quantum wire with the modulated chemical potential, which is described by
\hatH= \displaystyle\sum\nolimits_i\left \left( -t\hatc_i^\dagger \hatc_i+1+\Delta \hatc_i\hatc_i+1+ h.c.\right) +V_i\hatn_i\right
,
V_i=V\dfrac\cos \left( 2\textπ i\alpha + \delta \right) 1-b\cos \left( 2\textπ i\alpha+\delta \right) 
and can be solved by the Bogoliubov-de Gennes method. When
b=0
,
\alpha
is a rational number, the system undergoes a transition from topologically nontrivial phase to topologically trivial phase which is accompanied by the disappearance of the Majorana fermions and the changing of the
Z_2
topological invariant of the bulk system. We find the phase transition strongly depends on the strength of potential
V and the phase shift
\delta
. For some certain special parameters
\alpha
and
\delta
, the critical strength of the phase transition is infinity. For the incommensurate case, i.e.
\alpha=(\sqrt5-1)/2
, the phase diagram is identified by analyzing the low-energy spectrum, the amplitudes of the lowest excitation states, the
Z_2
topological invariant and the inverse participation ratio (IPR) which characterizes the localization of the wave functions. Three phases emerge in such case for
\delta=0
, topologically nontrivial superconductor, topologically trivial superconductor and topologically trivial Anderson insulator. For a topologically nontrivial superconductor, it displays zero-energy Majorana fermions with a
Z_2
topological invariant. By calculating the IPR, we find the lowest excitation states of the topologically trivial superconductor and topologically trivial Anderson insulator show different scaling features. For a topologically trivial superconductor, the IPR of the lowest excitation state tends to zero with the increase of the size, while it keeps a finite value for different sizes in the trivial Anderson localization phase.