For a one-dimensional chain of four nuclear spins (1/2) and taking into account first and second neighbor interactions among the spin system, we make the numerical simulation of Shor prime factorization algorithm of the integer number N=4 to study the influence of the second neighbor interaction on the performance of this algorithm. It is shown that the optimum Rabi's frequency to control the non-resonant effects is dominated by the second neighbor interaction coupling parameter (\(J'\)), and that a good Shor quantum factorization is achieved for a ratio of second to first coupling constant of \(J'/J\ge 0.04\).