Find if person go through given point A person start moving from $(0,0)$ in a weird pattern as follow :
In a single step he will move by one unit in the current direction it is moving.
Initially the person is at position $(0, 0)$.

*

*In the beginning he goes $1$ step to the East (i.e. In a single step, its $x$ coordinate will increase by $1$ unit.)


*Then $2$ steps to the North, (i.e. In a single step, its $y$ coordinate will increase by $1$ unit.)


*Then $3$ steps to the West, (i.e. In a single step, its $x$ coordinate will decrease by $1$ unit.)


*Then $4$ steps to the South, (i.e. In a single step, its $y$ coordinate will decrease by $1$ unit.)
then $5$ steps to the East,
and so on.
Thus each time he turns $90$ degrees anti clockwise, and it will go one more step than before.
The red line in the example shows the path traced by the man.

Now the question is that given a $(x,y)$ coordinate I need to tell if the person will go through that point or not.
Example : If coordinate is $(3,3)$ then answer is YES if its $(3,5)$ answer is NO.
 A: If $x\le0$, we are on the line iff $\max\{|x|,|y|\}$ is even.
If $x\ge0$, we are on the red line iff $\max\{|x|,|y-1|\}$ is odd.
A: Given the first point in the sequence is $(0,0)$, we may describe the sequence in the following manner -
$(x,y)_n = (0 + 1 + 0 - 3 + 0 + 5 + 0 - ...,0 + 0 + 2 + 0 - 4 + 0 + 6) $ (n terms in both series)
By grouping the terms appropriately, one can see that 
if $ n=4m$,
$(x,y)_{4m} = (-2m, 2m)$
if $ n=4m + 1$,
$(x,y)_{4m+1} = (-2m, -2m)$
if $ n=4m +2$,
$(x,y)_{4m+2} = (2m + 1, -2m)$
if $ n=4m +3$,
$(x,y)_{4m+3} = (2m + 1, 2m + 2)$
It can also be seen that the distance from the origin is non-decreasing. Hence, an algorithm to check whether the point (h, k) belongs to this sequence is to compute these four sequences until $x^2 + y^2 > h^2 + k^2$, comparing the point every iteration.
A: I think you can prove the followings by induction.
For $n\in\mathbb N$, the person turns around at 
$$(2n-1,-2n+2)\ \underrightarrow{y:4n-2}\ (2n-1,2n)\ \underrightarrow{x:-4n+1}\ (-2n,2n)$$$$\ \underrightarrow{y:-4n}\ (-2n,-2n)\ \underrightarrow{x:4n+1}\ (2(n+1)-1,-2(n+1)+2).$$
From this, you'll find the condition that the person will go through a given point.
A: I started looking at various segments traversed and saw some interesting patterns (no proofs):
$$\begin{array} {c|c|c} \text{Segment when}&\text{Other variable start}& \text{Other variable end}\\
y=0& x: 0&1\\
x=1&y:0&2\\
y=2&x:1&-2\\
x=-2&y:2&-2\\
y=-2& x: -2&3\\
x=3&y:-2&4\\
y=4&x:3&-4\\
x=-4&y:4&-4\\
y=-4&x:-4&5\\
x=5&y:-4&6
\end{array}$$
Based on these observations, it appears (and I think should be provable) that the points $(x,y)$ hit by this process satisfy (at least) one of the following four conditions:
(i) $x$ odd and positive; $y\in[-x+1,x+1]$
(ii) $x$ even and negative; $y\in [-x,x]$
(iii) $y$ even and nonpositive; $x\in [y,-y+1]$
(iv) $y$ even and positive; $x\in [-y,y-1]$
For instance, $(17,-11)$ falls into case (i).  Since $-11\in[-16,18]$, this point would be on the path.
A: Notice that all points where the person changes direction from east to north are along the line given by $x + y = 1$:

Similarly each turn from north to west is along the line where $y - x = 1$, each turn from west to south is along the line where $x + y = 0$, and each turn from south to east is along the line where $y - x = 0$.
Moreover, if a turn toward a given direction (for example, to the north) occurs at coordinates $(x,y)$ then the next turn in that direction will occur at coordinates 
$(x \pm 2,y \pm 2)$, where the sign of $\pm$ in each case is determined by the direction of the turn.
We can assign every point with integer coordinates $(x,y)$ to one (or two) of the four regions of the plane labeled A, B, C, or D in the diagram above, which are bounded by the four half-lines shown in light blue.


*

*A: If $|y - 1| \le x$, the point is touched if and only if $x$ is odd.

*B: If $|x + \frac12| \le y - \frac12$, the point is touched if and only if $y$ is even.

*C: If $|y| \le -x$, the point is touched if and only if $x$ is even.

*D: If $|x - \frac12| \le \frac12 - y$, then the point is touched if and only if $y$ is even.


One can prove all these statements mathematically, but I'll leave that as an exercise, at least for now.
