OFFSET
0,5
EXAMPLE
Terms are written in square boxes radiating spirally (cf. Ulam prime spiral). a(0) = 0, a(1) = 1, a(2) = 1 and a(3) = 1, so write 0, then 1 to its right, another 1 below the first 1 and another to the left of that. The next unfilled box forms an incomplete rectangle with the four filled boxes, so a(4) = a(0) + a(1) + a(2) + a(3) = 0 + 1 + 1 + 1 = 3. The next unfilled box forms the complete rectangle with the filled boxes. Since a(2) is nearer than a(3), a(5) = a(0) + a(1) + a(3) + a(4) = 0 + 1 + 3 + 5 = 9. In the case of a tie in nearness, the chronologically nearer value is used.
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Michael Joseph Halm, Apr 02 2004
STATUS
approved