A309500 The minimal number of steps to return to the origin for a self-avoiding walk with step-length n on a 2D plane where at each step the walk must go to an unvisited point with integer coordinates as close as possible to the origin.
4, 4, 4, 4, 36, 4, 4, 4, 4, 36, 4, 4, 122, 4, 36, 4, 198, 4, 4, 36, 4, 4, 4, 4, 436, 122, 4, 4, 632, 36, 4, 4, 4, 198, 36, 4, 694, 4, 122, 36
Offset: 1
Examples
a(1) = 4. Path: (0,0)->(0,1)->(1,1)->(1,0)->(0,0). a(5) = 36. Path: (0,0)->(4,3)->(1,-1)->(-3,2)->(0,-2)->(0,3)->(-3,-1)->(2,-1)->(-2,2)->(1,-2)->(1,3)->(-2,-1)->(2,2)->(-1,-2)->(-1,3)->(3,0)->(-2,0)->(2,3)->(-1,-1)->(3,2)->(3,-3)->(0,1)->(0,-4)->(-3,0)->(2,0)->(-2,3)->(-2,-2)->(2,1)->(-1,-3)->(-1,2)->(2,-2)->(-2,1)->(1,-3)->(1,2)->(4,-2)->(0,-5)->(0,0). Note this path is one of eleven with a total path length of 36. Five of those eleven paths step to (-3,2) on the third step while the other six step to (-2,3). The first step to the point (4,3) is required - a first step to (0,5) results in a minimum path length of 40.
Links
- Scott R. Shannon, Walk path for n=5. For this, and other images, the line colors are scaled from red to violet to show the relative step at which the point was visited. A white square marks the origin, a red square the first step point, and a violet square the last point before return to the origin, the path of which is marked with a white line. In this image only the smaller yellow squares indicate the points where the path had a choice of 2 points to go to which were equidistant from the origin. This is one of eleven different paths which return to the origin in 36 steps.
- Scott R. Shannon, Visited points for n=5. These points show a pattern which is repeated in the other minimum step walks - the majority of points about half a step length away from the origin are visited. This eventually forces the walk to move away from the origin at which point a coordinate one step length away from the origin is finally visited.
- Scott R. Shannon, Walk path for n=13.
- Scott R. Shannon, Walk path for n=17.
- Scott R. Shannon, Walk path for n=25.
- Scott R. Shannon, Visited points for n=25. This clearly shows the tendency for the minimal path to cover the points half a step length away from the origin before visiting the last point which is one step length away from the origin.
- Scott R. Shannon, Walk path for n=29. As the Pythagorean triple for 29 is (20,21,29) the diagonal steps are almost at 45 degrees to the axis which causes this path to form, in the authors opinion, a very aesthetically pleasing pattern. The next step length with legs one unit apart which has no other Pythagorean triples, and is thus likely to form a similar pattern, is 5741. Unfortunately the number of search paths to find the minimum in this instance would be astronomically large.
- Scott R. Shannon, Visited points for n=29.
- Scott R. Shannon, Walk path for n=37.
- Scott R. Shannon, Visited points for n=37.
- Scott R. Shannon, Walk path for n=53.
- Scott R. Shannon, Walk path for n=73.
- Scott R. Shannon, Walk path for n=89.
- Scott R. Shannon, Walk path for n=97.
- Wikipedia, Pythagorean Triples.
Formula
For step length n, also equal to the hypotenuse of one Pythagorean triple (a,b,n) where a>b, the first step of the walk can be either along the y axis or along the hypotenuse diagonal in the positive x-y direction (all other direction choices are equivalent by rotation/reflection). In the former case the first point will be (0,n), and thus the second point will be (b,n-a). From here a step directly left to (-(n-b),n-a) or diagonally down and left to (-(a-b),-(b-(n-a)) result in points equidistant from the origin - both are sqrt(3n^2-2bn-2an) from (0,0). So after only two steps two valid branches arise both of which must be explored. If instead the first step is along the hypotenuse to (a,b) then using simple algebra one can show that the next step will be to (-(n-a),b) if n>2b, else it will be to (a-b,-(a-b)) for n<2b. Note that in the former case the path (0,0)->(a,b)->(-(n-a),b) is rotationally symmetric to the path (0,0)->(0,n)->(b,n-a), so for step lengths n with n>2b only one of these options needs to be explored.
Comments