A367914 Movement sequence in the counter-clockwise undulating spiral, whereby 1, 2, 3, 4 represent moves to the right, down, left and up.
1, 4, 3, 4, 3, 2, 3, 2, 1, 2, 1, 2, 1, 4, 1, 4, 1, 4, 3, 4, 3, 4, 3, 4, 3, 2, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4
Offset: 1
Formula
a(k1)=1 with k1=i^2*8+i*0+2*j+1 with i,j >= 0 and j<=4i.
a(k2)=2 with k2=i^2*8+i*12+2*j+6 with i,j >= 0 and j<=4*i+3.
a(k3)=3 with k3=i^2*8+i*8+2*j+3 with i,j >= 0 and j<=4*i+2.
a(k4)=4 with k4=i^2*8+i*4+2*j+2 with i,j >= 0 and j<=4*i+1.
Comments