<s>[INST] Examples where $(a+b+\cdots)^2 = (a^2+b^2+\cdots)$ Consider the two infinite series
$$
    \frac{\pi}{\sqrt{8}} = 1 + \frac{1}{3} - \frac{1}{5} - \frac{1}{7} + \frac{1}{9} + \frac{1}{11} - \cdots
$$
and
$$
    \frac{\pi^2}{8} = 1 + \frac{1}{3^2} + \frac{1}{5^2} + \frac{1}{7^2} + \frac{1}{9^2} + \frac{1}{11^2} + \cdots
$$
(Notice that the first series has signs that go two-by-two rather than every-other.)
Squaring the first equality also gives $\pi^2/8$ and so these two, when put together, satisfy the 'highschooler's dream' for squaring a sum: just square each term and sum,
$$
    (a + b + c + \cdots)^2 = (a^2 + b^2 + c^2 + \cdots)
$$
with nothing like $2ab + 2ac + 2bc + \cdots$ needed.
A trivial example of this would be
$$
    (a + 0)^2 = a^2 + 2a0 + 0^2 = a^2 + 0^2
$$
but it only succeeds because one addend is zero.
My questions are

*

*Are there any other simple nontrivial examples?  I believe any other nontrivial example must be an infinite sum. edit: John Omielan provides the simple finite example $(1+1-\frac{1}{2})^2 = 1^2 + 1^2 + \frac{1}{2^2}$.

*Is there an "obvious" demonstration that the above sum (other than the direct evaluation) satisfies the highschooler's dream?  Put another way, is there a simple demonstration that the infinite sum of "cross terms" vanishes?

 [/INST] My answer is the same as Ivan's. However I give an alternative proof of his statement, which is too long for a comment.

You can take almost arbitrary first $k-1$ numbers $a_1$, $a_2$, ... ,
$a_{k-1}$ and always exists $a_k$ such that
$$(a_1+a_2+...+a_{k-1}+a_k)^2={a_1}^2+{a_2}^2+...+{a_{k-1}}^2+{a_k}^2$$

My Proof:
We have:
$$ (a_1+a_2+...+a_{k-1})^2=a_1^2+a_2^2+...+{a_{k-1}}^2 \iff \sum_{1\ \leq\ i\ <\ j\ \leq\ k-1} a_i a_j = 0. $$
Now let
$$a_k = \frac{ - \left(\displaystyle\sum_{1\ \leq\ i\ <\ j\ \leq\ k-1} a_i a_j\right) } { \displaystyle\sum_{i=1}^{k-1} a_i}.$$
This implies:
$$ \sum_{1\ \leq\ i\ <\ j\ \leq\ k} a_i a_j = \sum_{1\ \leq\ i\ <\ j\ \leq\ k-1} a_i a_j + a_k \sum_{i=1}^{k-1} a_i = 0, $$
with the definition of $a_k$ being possible if and only if $\displaystyle\sum_{i=1}^{k} a_i \neq 0.$
</s>