# Wild About Math!Making Math fun and accessible

6Aug/090

## MMM #37: Prizes 2 and 3

Today I'm announcing two more prizes for MMM #37.

Here is IB Yea's solution:

The problem is to find the algorithm for the coordinate and number for the spiral that goes like the following:

25 24 23 22 21
10 09 08 07 20
11 02 01 06 19
12 03 04 05 18
13 14 15 16 17

Basically, this is how the spiral goes:
From the starting point, it goes -1 via x, then -1 via y, then 2 via x, 2 via y, then -3 via x
and it repeats itself like that so that:

x-0 + -1 + 2 + -3 +...
y-0 + -1 + 2 + -3 +...

This comes from the fact that the sqare enveloping the square below always has its number starting
below the top left number, the highest one, which follows (2n+1)^2.
If so, then it has to go 2n-1 down (since the number below the top left one is included), 2n to the right (enveloping the bottom part of the square below and jutting out),
2n up, then 2n+1 to the left to completely cover the square below and start the next square. Also, the one previous to 2n-1 down is 2n-1 left because of the smaller square.

So basically,add up the numbers from the sum above to find x and y.
The sum above is the alternating series:
Sum n-(1 to n) ((-1)^n)*n

The equation above can be used in the following condition:
(1)The equation above for x and y, n can be the same,
or (2) n in x equation is 1 higher than n in y.
With those conditions, you can proceed to find the numbers in between by just adding numbers in x for condition (1)
or by adding numbers in y in condition (2)

Then, using those same numbers from the sum, plug it in the equation below and add it in the following way:

n=1+(sum |x|)+(sum |y|)

For example:
x=-1+1=0 n=1+(|-1|+|1|)+(|-1|)=3
y=-1

x=5=-1+2-3+4-5+6-7+8-9+10
y=2=-1+2-3+4-5+6-7+8-9+7
Plugged it in n=1+(|-1|+|2|+|-3|+...+|10|)+(|-1|+|2|+|-3|+...+|7|)=1+55+52=108
In the above case, a summation formula helps.

Albeit this method is really bad if you want to use large numbers. 🙁
Although it helps if you use 2a=n (in this case, n is the term in the series, a is the "answer")
since it alternates like this: -1, 1, -2, 2, etc

Watchmath has solutions posted here and here.

Stay tuned for a few more solutions and prizes.