Solution (source code)

= Solution

For a <quasi-compact scheme> $X$, the <Serre criterion for affineness> gives the equivalences
$$
\boxed{\begin{aligned}
X\text{ affine}
&\iff H^1(X,\mathcal F)=0\text{ for every quasi-coherent }\mathcal O_X\text{-module }\mathcal F\\
&\iff H^q(X,\mathcal F)=0\text{ for every such }\mathcal F\text{ and every }q>0.
\end{aligned}}
$$
Indeed, an <affine scheme> has <vanishing of quasi-coherent cohomology on an affine scheme>. Conversely, vanishing of the first <sheaf cohomology> for every <quasi-coherent sheaf> includes every <quasi-coherent sheaf> of ideals, which suffices for the criterion. No <separated scheme> hypothesis is needed in this formulation. Nor may one test only the <structure sheaf>.https://stacks.math.columbia.edu/tag/01XF[Stacks Project, Serre's criterion for a quasi-compact scheme, using quasi-coherent ideals]{ref}