can $x^2+a=y^2$ where a is prime Let a sequence of the sum of prime numbers be $S_1=2$, $S_2=5$, $S_3=10$, $S_4=17...$
Can $S_n$ and $S_{n+1}$ both be square numbers $x^2$ and $y^2$ respectively?
I have already made the observation that $x^2+a=y^2$
$a=(y+x)(y-x)$
and therefore $y-x=1$ and $x+y=a$ for this to hold.

If $S_n=x^2$, and $S_{n+1}=y^2,$ then, as you’ve noticed, $y+x=p_{n+1}, y-x=1.$ Solving these equations:
$$y=\frac{p_{n+1}+1}2,x=\frac{p_{n+1}-1}2$$
This also means that you need $$S_n=\left(\frac{p_{n+1}-1}2\right)^2.$$
Now for $n\geq 5:$
$$\begin{align}S_n&<1+3+5+7+9+11+\cdots +p_n\\&= \left(\frac{p_n+1}2\right)^2\\&\leq\left(\frac{p_{n+1}-1}2\right)^2\end{align}$$
(Where the first sum is the sum of the odd numbers from $1$ to $p_n,$ where the sum of the first $k$ odd numbers is known to be $k^2.$)
So there are no example $n\geq 5.$
You just need to check $n=1,2,3,4$ by hand.
