\section{Introduction} \label{sec:intro} Let $\psi(x)=\sum_{n\le x}\Lambda(n)$ be the Chebyshev prime-counting function. We ask a simple question: \emph{how well do the primes up to $X$ determine, by a fixed linear rule, the primes beyond $X$?} More precisely, given the past values $\psi(y)$ for $y\le x/2$, how accurately can a single finite linear combination of them, with weights chosen once and for all, predict $\psi(x)$? From the explicit formula, the normalised error term $E(u)=e^{-u/2}(\psi(e^u)-e^u)$ is a superposition of waves oscillating at the ordinates $\gamma$ of the nontrivial zeros $\rho=\tfrac12+i\gamma$ of the Riemann zeta function $\zeta$, with amplitudes $\abs{\rho}^{-1}$. A linear predictor looking back a multiplicative factor $N$ in $x$ observes a window of additive length $L\approx\log N$ in the logarithmic variable $u=\log x$. Because the zeros at height $T$ have local density $\frac1{2\pi}\log(T/2\pi)$, a window of length $L$ can be expected, by Landau's density heuristic \citep{Landau1967}, to resolve frequencies up to height $T\approx e^L=N$ and no further. Since the unresolved zeros above height $N$ carry spectral mass $\sum_{\abs\gamma>N}\abs{\rho}^{-2}\asymp(\log N)/N$, one should hope for a mean-square prediction error decaying like $1/N$ up to logarithmic factors---and one may ask both whether an explicit predictor achieves this rate, and whether any finite window can ever predict $\psi(x)$ exactly. \paragraph{Chebyshev's 1852 identity as a linear predictor.} Remarkably, an explicit predictor was written down more than 170 years ago. Chebyshev's alternating identity (\cref{lem:chebyshev}) states that for every real $x\ge1$, \begin{equation*} \psi(x)-\psi\Bigl(\frac x2\Bigr)+\psi\Bigl(\frac x3\Bigr)-\psi\Bigl(\frac x4\Bigr)+\dotsb \;=\;\log\frac{\floor{x}!}{\floor{x/2}!^{2}}. \end{equation*} The right-hand side is an explicit elementary function of $x$, equal to $x\log 2+O(\log x)$. Rearranging thus expresses $\psi(x)$ \emph{exactly} as an affine combination of its own past values $\psi(x/2),\psi(x/3),\dots$; it is a perfect linear predictor, at the cost of looking all the way back to $n\approx x$. What happens when we truncate the series at a fixed length $N$? On the frequency side, the mechanism is completely transparent. Subtracting the main term $x\log 2$, the explicit formula $\psi(y)-y=-\sum_\rho y^\rho/\rho+(\text{lower order})$ turns any weighted alternating sum of $\psi(x/n)-x/n$ into a sum over the zeros $\rho$ of $\zeta$, weighted by the Dirichlet polynomial \[ \AN(s)=\sum_{n\ge1}(-1)^{n-1}w(n/N)\,n^{-s}, \] where $w$ is either a smooth cutoff supported on $[0,2]$ with $w\equiv1$ on $[0,1]$, or simply the sharp indicator $w=\mathbf 1_{[0,1]}$ (for which we write $\ANsharp(s)=\sum_{n\le N}(-1)^{n-1}n^{-s}$). Without truncation ($w\equiv1$), the series is the Dirichlet eta function $\eta(s)=(1-2^{1-s})\zeta(s)$, which is entire and vanishes at every nontrivial zero of $\zeta$: Chebyshev's identity is simply the statement $\eta(\rho)=0$, seen from the primes. With truncation at scale $N$, $\AN(\rho)$ remains small throughout the low range $\abs\gamma\le N$: \begin{itemize} \item For the \emph{sharp} cutoff, writing $\ANsharp(s)=\sum_{n\le N}n^{-s}-2^{1-s}\sum_{m\le N/2}m^{-s}$ and applying the Hardy--Littlewood approximation to $\zeta(s)$ makes the pole terms $N^{1-s}/(1-s)$ cancel identically, leaving $\ANsharp(\rho)=O(N^{-1/2})$ uniformly for $\abs\gamma\le N$ (\cref{lem:sharp}). The low zeros contribute only $O(1/N)$ to the mean-square error. \item For a \emph{smooth} cutoff, Mellin contour shifting yields super-polynomial decay $\abs{\AN(\rho)}\le C_k\bigl((1+\abs\gamma)/N\bigr)^k$ for every $k\ge1$ (\cref{lem:mellin}), suppressing the low zeros almost completely. \end{itemize} In both cases the prediction error is governed by the high zeros $\abs\gamma>N$. There $\AN(\rho)$ behaves like a generic Dirichlet polynomial of length $O(N)$ and mean square $\asymp\log N$, while the tail weight is $\sum_{\abs\gamma>N}\abs{\rho}^{-2}\asymp(\log N)/N$. Multiplying mass by mean square produces the naive count $(\log N)^2/N$---and our main analytic estimate (\cref{prop:meansq}) matches this $(\log N)^2/N$ bound rigorously for both cutoffs. \paragraph{Main results.} By the Riemann hypothesis (\RH), now established and formally verified \citep{Alpoge2026remark,AlpogeLean2026} (see also \citealp{AxiomMath2026ERH}), every nontrivial zero of $\zeta$ lies on the critical line $\re\rho=\tfrac12$, so all of our results hold unconditionally. Our first main result establishes the asymptotic prediction error for the actual Chebyshev function $\psi(x)$ (\cref{thm:actual}). For a fixed cutoff $w$ (either smooth or sharp) and real $N\ge1$, let $\DeltaN(x)$ denote the error of the truncated Chebyshev predictor of $\psi(x)$ from the values $\psi(x/n)$ with $2\le n<2N$ (or $2\le n\le N$ for the sharp cutoff $\DeltaNsharp$; see \eqref{eq:DeltaN}--\eqref{eq:DeltaNsharp}), and let $m_\rho\ge1$ be the multiplicity of a zero $\rho$. For every $N\ge1$, the logarithmic mean-square error exists and satisfies \begin{equation*} \lim_{X\to\infty}\frac{1}{\log X}\int_1^X\abs{\DeltaN(x)}^2\,\frac{\rd x}{x^2} \;=\;\sum_\rho m_\rho\,\frac{\abs{\AN(\rho)}^2}{\abs{\rho}^2} \;\le\; C'\,\frac{\log^3(2N)}{N}, \end{equation*} with the same bound for $\DeltaNsharp$ and $\ANsharp$; if all zeros of $\zeta$ are simple, the upper bound improves to $C\log^2(2N)/N$. For comparison, the trivial predictor $\psi(x)\approx x$ has logarithmic mean-square error $\sum_\rho m_\rho\abs{\rho}^{-2}\ge 2+\gamma_E-\log(4\pi)=0.04619\ldots$ (root mean square at least $0.215$). Thus $\DeltaN(x)/\sqrt{x}$ has logarithmic mean square $O(\log^3(2N)/N)$ as $N\to\infty$, with constants $C,C'$ depending only on $w$ (and inexplicit). Our second main result analyses the optimal linear prediction error in the associated stationary spectral model (\cref{thm:model,thm:upper,thm:positive}). Let $\mu=\sum_\rho\abs{\rho}^{-2}\delta_\gamma$ be the finite purely atomic measure putting mass $\abs{\rho}^{-2}$ at each zero ordinate $\gamma$ (with multiplicity). For a log-window length $L\ge0$ and prediction horizon $\tau>0$, let \[ \sigsq(L,\tau)\;=\;\inf\Bigl\{\Bigl\|e_\tau-\sum_{j=1}^J a_j\,e_{-s_j}\Bigr\|_{\Ltwo}^2\;:\;J\ge1,\ a_j\in\C,\ s_j\in[0,L]\Bigr\} \] be the squared distance in $\Ltwo$ from $e_\tau(\gamma)=e^{i\tau\gamma}$ to the closed span of the past $\set{e_{-s}:0\le s\le L}$ (\cref{sec:prelim} explains the Kolmogorov isomorphism linking $\sigsq(L,\tau)$ to prediction of $E(u)$). There is an absolute constant $c>0$, and for every $\tau>0$ a constant $C_\tau>0$ (independent of $\tau$ for $0<\tau\le\log2$), such that for all $L\ge1$, \begin{equation*} \tau\exp\bigl(-\exp\bigl(c(L+\tau+1)\bigr)\bigr) \;\le\;\sigsq(L,\tau) \;\le\;C_\tau\,(L+\tau)^2 e^{-(L+\tau)}. \end{equation*} The upper bound is achieved explicitly by the sharp truncated Chebyshev identity with $N=e^{L+\tau}$ (and by the smooth version with $2N=e^{L+\tau}$), combined with a finite Dirichlet-inverse correction when $\tau>\log2$. Moreover, the lower bound is governed directly by the maximal gaps between consecutive zeta zeros: if $\gamma_{n+1}-\gamma_n\le B/\log\gamma_n$ for all sufficiently large $n$, then $\sigsq(L,\tau)\ge c_1\tau e^{-c_2(L+\tau)}$ for constants $c_1,c_2>0$ depending only on $B$. \paragraph{Overview of the proofs.} Four ideas drive the proofs: \begin{enumerate} \item \emph{Matching the naive upper bound via contour integration (\cref{prop:meansq}).} Bounding $\sum_{T<\gamma\le2T}\abs{\AN(\rho)}^2$ by a Sobolev inequality on unit intervals and the Montgomery--Vaughan mean value theorem differentiates $\AN$ and loses an extra logarithm, stopping at $\log^3(2N)/N$. Instead, because $\AN$ has real coefficients and every nontrivial zero satisfies $\bar\rho=1-\rho$, we have $\abs{\AN(\rho)}^2=\AN(\rho)\AN(1-\rho)$, which is the residue of $(\zeta'/\zeta)(s)\AN(s)\AN(1-s)$ at $\rho$. Integrating around a rectangle with vertical sides $\re s=1+\delta$ and $\re s=-\delta$ ($\delta=\frac1{2\log(2N)}$) and horizontal cuts chosen by averaging over the large set of heights staying $\gg 1/\log T$ away from all zeros splits the sum into two pieces: a functional-equation term shifted back to $\re s=\tfrac12$ and bounded by Montgomery--Vaughan ($O(T\log T\log N)$), and an absolutely convergent Dirichlet-series term on $\re s=1+\delta$ bounded directly by elementary summation ($O(T\log^2 N)$). Dividing by $T^2$ and summing dyadically gives $\log^2(2N)/N$ for both smooth and sharp cutoffs. Multiplying by the trivial multiplicity bound $m_\rho\ll\log(2+\abs\gamma)$ yields $\log^3(2N)/N$ in \cref{prop:meansqmult} (and Littlewood's bound $m_\rho\ll\log\abs\gamma/\log\log\abs\gamma$ shaves off a further $\log\log(4N)$ factor; \cref{rem:multiplicity}). \item \emph{Longer horizons by Dirichlet inversion (\cref{thm:upper}).} For $\tau>\log 2$, the lags $\tau-\log n$ with $n0$. \paragraph{Relation to prior work.} Weighted sums $\sum_n a_n\psi(x/n)$ go back to \citet[p.~371, eq.~(2)]{Chebyshev1852}, who used $\sum_{n\ge1}\psi(x/n)=\log\floor{x}!$ and finite combinations such as $a_1=1,a_2=-2$ to establish the true order of $\psi(x)/x$. In the Chebyshev--Sylvester tradition, \citet{DiamondErdos1980} constructed finite weights approximating the M\"obius function to obtain elementary bounds on $\psi(x)/x$ arbitrarily close to $1$. Whereas those works control the leading scale $x$, we interpret the truncated alternating Chebyshev identity as a linear predictor at the fluctuation scale $\sqrt x$, in mean square, through the zeros of $\zeta$. The covariance kernel $k(v)=\int_\R e^{i\gamma v}\rd\mu(\gamma)$ of our stationary model coincides with the function $H_1(e^{\abs v})$ studied by \citet{MatsumotoSuzuki2024Mscrew}, who derived its closed form in terms of the primes \citep[Proposition~6.1]{MatsumotoSuzuki2024Mscrew} and proved that $H_1(e^t)-H_1(1)$ being a Krein screw function is equivalent to \RH{} \citep[Theorem~1.3]{MatsumotoSuzuki2024Mscrew}; see also \citet{Suzuki2022screw}. The logarithmic mean square of $\psi(x)-x$ is Cram\'er's theorem \citep{Cramer1922} (see \citealp[Theorem~13.6]{MontgomeryVaughan2007}); the limit identity in \cref{thm:actual} extends Cram\'er's theorem to a finite combination of translates of $E$, of the general type treated by \citet[Theorem~1.14]{AkbaryNgShahabi2014}, and we include a self-contained proof. On the prediction-theory side, a stationary process with a purely atomic spectral measure is deterministic in the Szeg\H{o}--Kolmogorov--Krein sense \citep{Doob1953,Krein1954,DymMcKean1976,Bingham2021prediction}, meaning $\sigsq(L,\tau)\to0$ as $L\to\infty$. Quantitative convergence rates are well studied for discrete-time processes with spectral \emph{densities} \citep{BabayanGinovyan2023survey}, but we are not aware of quantitative prediction bounds for an atomic spectrum like $\mu$ whose atoms grow denser with height. \paragraph{Organisation.} \Cref{sec:prelim} fixes notation, reviews the kernel $k(v)$, defines the prediction problem, and proves Chebyshev's alternating identity along with its higher-horizon correction. \Cref{sec:results} states all main theorems with proof ideas and gives the direct proofs of \cref{thm:upper,thm:model}. \Cref{sec:numerics} presents the numerical experiments on zeros, optimal log-integer predictors, and actual primes. \Cref{sec:discussion} formulates \cref{conj:rate}, diagnoses the obstacles to closing the remaining gaps, and poses open problems and conceptual connections. Complete, self-contained proofs of \cref{lem:mellin,lem:sharp}, \cref{prop:meansq,prop:meansqmult}, \cref{thm:positive}, and \cref{thm:actual} are collected in \cref{sec:proofs}.