Enlarge image
Photo: DER SPIEGEL
You hear your name and should appear on the blackboard - these are not necessarily the best memories of school.
Fortunately, you are spared the helpless guesswork in front of the class.
But maybe you would have solved the task that is on the top of the board with flying colors?
It's about the square numbers from 12 to 1002. Find the sum of all even square numbers and subtract the sum of all odd square numbers.
What is the result of the calculation?
The result is
5050
.
This corresponds exactly to the sum of all the numbers from 1 to 100.
Finding the solution isn't particularly difficult when we use the binomial formula
a
2
- b
2
= (ab) * (a + b)
use.
We rearrange the squares - in descending order of size and add the corresponding sign in each case - i.e. plus or minus:
Sum = 1002 - 992 + 982 - 972 + ... + 22 - 12
Now we rewrite the differences from two square numbers using the binomial formula:
Sum = (100 - 99) * (100 + 99) + (98 - 97) * (98 + 97) + .... + (2 - 1) * (2 + 1)
Because neighboring numbers always differ by exactly 1, we can simply omit the expressions (100 - 99), (98 - 97) and so on.
This simplifies the calculation considerably:
Sum = 100 + 99 + 98 + 97 + ... + 2 + 1
We don't have to add the numbers from 1 to 100 in our heads, we use the trick with which the mathematician Carl Friedrich Gauß once impressed his teacher as a student.
To do this, we simply rearrange the numbers to 50 pairs, the sum of which is 101 each:
Sum = (100 + 1) + (99 + 2) + ... (51 + 50)
Sum = 50 * 101 = 5050
If you missed a puzzle from the past few weeks, here are the ten most recent episodes:
On the brink
Secret access code
Who lies?
Who is telling the truth
How does the sequence of numbers continue?
The round is in the square
The magic number triangle
Built on a gap
The racing bike clique
A king on the run
The carpet repair