# Fisher’s test of periodicity

I have evenly sampled time series on which I applied Fourier transform. I am trying do determine if the signal contains statistically significant periodic components. I have succeeded with determining period. Now I am trying to calculate p-value for this component using these formulas derived by Fisher:

\begin{align}
I(\lambda) &= \frac{1}{2\pi n}\bigg|\sum_{t=1}^n X_te^{-it\lambda}\bigg|^2 \\[5pt]
Y_r &= \frac{I(\lambda_r)}{\sum_{j=1}^mI(\lambda_j)}, \qquad r = 1, \ldots, m, \\[5pt]
P(Y>y) &= 1- \sum_{j=0}^m (-1)^j{m\choose j}(1-jy)_+^{m-1}
\end{align}

The first formula is just squared discrete Fourier transfom.

$n$ – length of time data series
$m = (n – 1) / 2$ is number of AC harmonic components without Nyquist frequency

The problem I am solving is that for some values of $g$-statistics (denoted as $Y_r$ in this example) the sum of series is diverging. Let’s take an example:
\begin{align}
n &= 287 \\
m &= 143 \\
y &= 0.0044598585072423936
\end{align}
Partial sum for $j = 1$ is:
$$(-1)^1 + 143C1 \times (1 – 0.0044598585072423936)^142 = -75.802$$
The meaning of P value is probability which should be number between 0 (the event never occurs) and 1 (the event occurs always). Adding next terms to the sum just make the resulting value larger in absolute value. Is there something I am doing incorrectly?