OFFSET
0,3
COMMENTS
A spiral on the simple square grid is constructed starting at (0,0) and walking in the closest self-avoiding clockwise loop: up 1 unit, right 1 unit, down 2 units, left 2 units, up 3 units etc. The step widths in the x-coordinate are 0, 1, 0, -2, 0, 3, ... a signed version of A142150; the step widths in the y-coordinate are 1, 0, -2, 0, 3, ... The x-coordinate after n steps (n>=0) is a signed variant of A002265(n+3), namely 0, 0, 1, 1, -1, -1, 2, 2, -2, -2, 3, ...; the y-coordinate after n steps is 0, 1, 1, -1, -1, 2, 2, ... (n >= 0). The sum of the x- and y-coordinates after n steps (at corners of the spiral) is c(n) = 0, 1, 2, 0, -2, 1, 4, 0, -4, 1, 6, 0, -6, 1, 8, 0, ..., with g.f. -x*(1+x)/( (x-1)*(x^2+1)^2). The current sequence is obtained by recording the sum of the two coordinates at all intermediate positions walking with a stride of 1 along the edges of the spiral, equivalent to showing all interpolating integers between two values of c(n). The first differences a(n+1)-a(n) are two 1's, four -1's, six 1's, eight -1's etc., blocks of +1 and -1 with run lengths increasing by 2. - R. J. Mathar, Jan 22 2011
LINKS
Peter Kagey, Table of n, a(n) for n = 0..10000
EXAMPLE
Spiral begins at x=0, y=0, then moves up-right-down-left-up-right-...
a(0)=0+0=0, a(1)=1+0=1, a(2)=1+1=2, a(3)=0+1=1, a(4)=-1+1=0, a(5)=-1+0=-1, ...
CROSSREFS
KEYWORD
sign
AUTHOR
Vladimir Joseph Stephan Orlovsky, Jan 21 2011
STATUS
approved