Simple algorithm to get the square of an integer using only addition? This problem was mentioned in passing in a reading and it piqued my curiosity.

I'm not sure where to start. Any pointers? (perhaps square root was meant?)
An algorithm to do this for integers would be (in pseudo-code):

 input a
 b = abs a
 s = 0
 while b &gt; 0 do
      s = s + a
      b = b - 1
 return s
$$a^2= 2((a - 1) + (a - 2) + ... + 1) + a$$

Imagine a square of side 5 units
(Going clockwise) Add one side (5), then another (4) on and on...

It will give you this:
$$2\times(4 + 3 + 2 + 1) + 5 = 25 = 5^2$$