Let \begin{equation} g (n) = 2 \pi e^{1 + W \left( \frac{8 n + 1}{8 e} \right)} \end{equation} be the approximate value of the $n$-th Gram point.
Let
\begin{equation}
G (n) = \frac{Z (g (n))}{| Z (g (n)) |} + \frac{Z (g (n + 1))}{| Z (g (n +
1)) |}
\end{equation}
where Z is the Hardy Z function then the function defined by
\begin{equation}
B (n) = \frac{1}{4} G (n - 1) G (n)
\end{equation}
takes on the value $1$ when $n$ is a bad Gram point for which $(- 1)^{n
+ 1} Z (g (n)) > 0$ and the value $0$ when it is a good Gram point $(-
1)^{n + 1} Z (g (n)) < 0$.
The formula fails around n=20,000 or so