This one I solved using just paper and pencil, and am happy about it. All that was required was a keen observation on how the numbers along the diagonal form out of the previous number. Lets take a look at one of the diagonals of the 5 x 5 spiral
21 22 23 24 25
20 07 08 09 10
19 06 01 02 11
18 05 04 03 12
17 16 15 14 13
Consider the numbers along the diagonal originating in the center at 01 moving towards the upper right corner. The numbers are 01, 09, 25. Let me tell you that the next number along this diagonal will be 49. Do you see any pattern emerging yet?
Well, all these number are squares -
Considering the distance of the number from the center of the spiral as a parameter, this series can be written as:
The numbers along the other diagonals are simply derived from by subtracting certain values.
Now, all that the problem asks us to do is to sum up the numbers for
.
for
This is a simple summing up exercise. Solved !!
Popularity: 12% [?]
Related posts:
0 Responses to “Project Euler : Sum Of Both Diagonals In A 1001 By 1001 Spiral”