Sum of Betti numbers of a degree $d$ hypersurface of $\mathbb{P}^n_{\mathbb{C}}$ Let $X \subseteq \mathbb{P}^n_{\mathbb{C}}$ be the zero set of a homogeneous polynomial of degree $d$. Assume that $X$ is smooth. Is there a way to find the sum of the Betti numbers of $X$ (i.e. the ranks of the (singular) homology groups over a field $k$)? I am glad about any kind of results and in particular I am interested in the case when $k=\mathbb{Z}_2$ is the field with two elements. If not, can we at least bound it from above?
 A: (Let me answer the case of coefficients in $\mathbf Z$ (or $\mathbf Q$ or $\mathbf R$ or $\mathbf C$.) I think it should only take a bit of universal coefficient wizardry to deduce the answer in general, but it is too late here for that.)


*

*First, by the Lefschetz hyperplane theorem and Poincaré duality, we have an isomorphism 
$$ H_i(\mathbf P^n, \mathbf Z) \cong H_i(X,\mathbf Z)$$ 
for all $i$ except $i=\operatorname{dim } X$. So  there is only one Betti number left to find.

*Since we know all but one Betti number, and we know which degree the missing one is in, finding that last one is equivalent to finding the Euler characteristic. But now the Euler characteristic is the degree of the top Chern class $c_{n-1}(X)$. Finally, to calculate that, we use the exact sequence of bundles
$$ 0 \rightarrow T_X \rightarrow (T_{\mathbf P^n})_{|X} \rightarrow N_X \rightarrow 0 $$
(where $N_X$ is the normal bundle) and the Whitney sum formula, which gives
$$ c(T_{\mathbf P^n})_{|X}  = c(T_X)\, c(N_X) .$$
The Euler sequence gives $c(T_{\mathbf P^n})=(1+H)^{n+1}$, and it is a basic fact about hypersurfaces that $c(N_X)=(1+dH)_{|X}$. Putting all this together, you can calculate the required class $c_{n-1}(T_X)$ and get your answer.
Exercise: Apply the above in the case where $X$ is a smooth quartic surface in $\mathbf P^3$ and show that $b_2(X)=22$. 
A: By the Lefschetz Hyperplane Theorem, the inclusion $i : X \hookrightarrow \mathbb{CP}^n$ induces a map $i^* : H^q(\mathbb{CP}^n, \mathbb{Z}) \to H^q(X, \mathbb{Z})$ which is an isomorphism for $q \leq n - 2$ and is injective for $q = n - 1$. Recall that 
$$b_q(\mathbb{CP}^n) = \operatorname{rank} H^q(\mathbb{CP}^n, \mathbb{Z}) = \begin{cases}
1 & q\ \text{even}, 0 \leq q \leq 2n,\\
&\\
0 & \text{otherwise}.
\end{cases}$$
Note that $X$ has complex dimension $n - 1$ and therefore real dimension $2n - 2$. By Poincaré duality $b_q(X) = b_{2n - 2 - q}(X)$, so the only Betti number of $X$ that we haven't established is $b_{n-1}(X)$.
Combining these results, we have
\begin{align*}
\sum_{q=0}^{2n-2}b_q(X) &= \sum_{q=0}^{n-2}b_q(X) + b_{n-1}(X) + \sum_{q=n}^{2n-2}b_q(X)\\ 
&= 2\sum_{q=0}^{n-2}b_q(X) + b_{n-1}(X)\\ 
&= 2\left\lfloor\frac{n}{2}\right\rfloor + b_{n-1}(X).
\end{align*}
However, we know that $b_{n - 1}(X) \geq b_{n-1}(\mathbb{CP}^n)$ by the injectivity of $i^*$. Therefore
$$\sum_{q=0}^{2n-2}b_q(X) = b_{n-1}(X) + 2\left\lfloor\frac{n}{2}\right\rfloor  \geq b_{n-1}(\mathbb{CP}^n) + 2\left\lfloor\frac{n}{2}\right\rfloor = n.$$

Note, you can actually determine $b_{n-1}(X)$ (and hence the sum) exactly, but the expression is a little complicated. I won't put in all the details right now, but here's how it goes.
First, let $B(X)$ denote the sum of Betti numbers of $X$. Using the results above, one can show that $B(X) = \chi(X) + (1 - (-1)^{n-1})b_{n-1}(X)$; in particular, if $n$ is odd, we see that $B(X) = \chi(X)$. Combining with the expression for $B(X)$ above, we see that $b_{n-1}(X) = (-1)^{n-1}(\chi(X) - 2\lfloor\frac{n}{2}\rfloor)$.
Using Chern classes, one can show that the Euler characteristic of $X$ is given by
$$\chi(X) = \sum_{j=0}^{n-1}(-1)^jd^{j+1}\binom{n+1}{j+2}.$$
Therefore, assuming I haven't made any mistakes, we have
$$B(X) = 2\left\lfloor\frac{n}{2}\right\rfloor + (-1)^{n-1}\left(\sum_{j=0}^{n-1}(-1)^jd^{j+1}\binom{n+1}{j+2} - 2\left\lfloor\frac{n}{2}\right\rfloor\right),$$
which can be rewritten as
$$B(X) = (-1)^{n-1}\sum_{j=0}^{n-1}(-1)^jd^{j+1}\binom{n+1}{j+2} + 2(1 - (-1)^{n-1})\left\lfloor\frac{n}{2}\right\rfloor.$$
Splitting into cases, we have
$$B(X) = \begin{cases}
\displaystyle\sum_{j=0}^{n-1}(-1)^jd^{j+1}\binom{n+1}{j+2} & n\ \text{odd},\\
&\\
-\displaystyle\sum_{j=0}^{n-1}(-1)^jd^{j+1}\binom{n+1}{j+2} + 2n & n\ \text{even}.
\end{cases}$$
which is the same as
$$B(X) = \begin{cases}
\chi(X) & n\ \text{odd},\\
&\\
-\chi(X) + 2n & n\ \text{even}.
\end{cases}$$
