Spirals for Scott

Hello Math-Fun,

Scott S. has accepted, in the past, to submit a few sequences together with me to the OEIS — and I take this opportunity to thank him again. Some sequences were related to a chess knight placed in the center of an infinite spiral of integers (see below the wonderful and surprising Numberphile video with Neil Sloane).

I had this first idea yesterday: instead of numbers in square cells, we could tile the grid with a spiral of horizontal dominoes (in the form of a diamond, see below – thank you Maximilian!-)

Those dominoes would be distinct « double-dominoes », thus we would start somewhere with the 0-0 domino, then spiral with the 1-1, followed by the 2-2, the 3-3, the 4-4, etc.

Note the position of the 30-30 domino: this is because two successive
dominoes cannot share the same horizontal line in the "diamond-like" shape

We place now the knight on one of the two zeros and ask him, as before, to jump always on the smallest available integer (without repeat). Will this new path beat Neil's one (2084 jumps)? 
Best,
É.
(What do you think, Scott?)
The Numberphile video:
https://youtu.be/RGQe8waGJ4w
(I'll post tomorrow another spiral challenge for Scott!-)
_______________________
October 20 update.
Maximilian brought the good news this morning: Neil's journey is shorter than the above!
Many thanks and bravo, Maximilian!
_______________________
Hello Eric,
> yes, I think this beats the record, with a tour of 2550 hops.

I understood well only after looking at the picture on your blog, 
showing that the dominoes are placed in a "diamond type" spiral,
 _  _  _  6  6  _  _  _  _
 _  _  5  5  7  7  _  _  _
 _  4  4  0  0  8  8  _  _
 _  _  3  3  1  1  9  9  _
 _  _  _  2  2  10 10 _  _
 _  _  _  _  11 11 _  _  _

This sequence is produced by the code for A326924 with domino instead of norml2 in the following (ugly, inefficient) manner:

DD=Map(["pos",0; "side",0]); domino(x, z=[1,I]~)={ while(!mapisdefined(DD, x*z, &z), 
my(pos=mapget(DD,"pos"), side=mapget(DD,"side"), dir=(1+I)*I^side); 
for(i=0,side\2, mapput(DD, pos, #DD\2-1); mapput(DD, pos+1, #DD\2-1); pos+=dir); 
mapput(DD,"pos",pos); mapput(DD,"side",side+1)); z}

To see the dominos: 
printp(matrix(20,20,i,j,domino([j-9, i-9])))

Then the list of squares corresponding to the knight's tour is produced by A326924 with 

{local(coords(n, m=sqrtint(n), k=m\/2)=if(m<=n-=4*k^2, [n-3*k, -k], n>=0, [-k, k-n], n>=-m, [-k-n, k], [k, 3*k+n]), U=[]/* used squares */, K=vector(8, i, [(-1)^(i\2)<<(i>4), (-1)^i<<(i<5)])/* knight moves */, pos(x, y)=if(y>=abs(x), 4*y^2-y-x, -x>=abs(y), 4*x^2-x-y, -y>=abs(x), (4*y-3)*y+x, (4*x-3)*x+y), t(x, p=pos(x[1], x[2]))=if(p<=U[1]||setsearch(U, p), oo, [domino(x), p]), nxt(p, x=coords(p))=vecsort(apply(K->t(x+K), K))[1][2]); my(A=List(0)/*list of positions*/); for(n=1, oo, U=setunion(U, [A[n]]); while(#U>1&&U[2]==U[1]+1, U=U[^1]); iferr(listput(A, nxt(A[n])), E, /*print(E);*/break)); print("Index of last term: ", #A-1); SQUARE(n)=A[n+1];}

Index of last term: 2550

The list of positions, numbered in the traditional "square spiral" manner, is:

apply(SQUARE,[0..99]) \\ first 100 squares
= [0, 11, 14, 1, 4, 13, 10, 3, 18, 7, 2, 5, 22, 9, 28, 31, 60, 15, 32, 29, 52, 25, 8, 27, 12, 53, 26, 23, 6, 17, 34, 59, 30, 87, 126, 51, 24, 45, 20, 39, 16, 33, 58, 55, 86, 125, 50, 47, 76, 21, 40, 67, 36, 61, 94, 57, 54, 85, 176, 129, 56, 93, 138, 187, 92, 137, 96, 35, 38, 19, 68, 37, 62, 95, 136, 91, 88, 127, 84, 49, 78, 115, 44, 77, 114, 43, 70, 105, 66, 63, 140, 189, 246, 135, 188, 139, 248, 313, 186, 247]
apply(SQUARE,[2500..2550]) \\ last 51 squares
= [2514, 2127, 1944, 1769, 1446, 1295, 1440, 1757, 2106, 2487, 2900, 3345, 3822, 4331, 4872, 4595, 4868, 5149, 5438, 5145, 4860, 4583, 4314, 3803, 3326, 2879, 2464, 2267, 1900, 1565, 1730, 1899, 2080, 2269, 2668, 2463, 2266, 2077, 1726, 1561, 1408, 1405, 1718, 2063, 1884, 2059, 2242, 2635, 3060, 3283, 3056]

The labels on the corresponding dominoes are:

[domino(coords(SQUARE(n))) | n <- [0..99]]
 = [0, 1, 2, 0, 3, 2, 8, 3, 4, 5, 1, 4, 6, 7, 9, 11, 12, 14, 11, 10, 24, 22, 7, 8, 10, 9, 23, 6, 5, 15, 13, 12, 27, 26, 48, 23, 22, 19, 18, 16, 14, 13, 28, 27, 25, 47, 46, 21, 20, 18, 17, 35, 33, 32, 29, 28, 26, 24, 49, 51, 52, 29, 30, 55, 53, 30, 31, 33, 15, 17, 16, 34, 32, 31, 54, 53, 51, 25, 47, 45, 44, 41, 19, 20, 41, 39, 38, 36, 34, 60, 58, 57, 88, 54, 55, 58, 56, 89, 87, 56]

 [domino(coords(SQUARE(n))) | n <- [2500..2550]]
%216 = [1285, 1284, 1282, 1428, 1279, 1278, 1137, 1275, 1273, 1419, 1417, 1571, 1569, 1731, 1729, 1566, 1409, 1408, 1405, 1404, 1555, 1554, 1713, 1551, 1397, 1251, 1249, 1248, 1246, 1108, 1109, 1246, 1247, 1112, 1250, 1249, 1392, 1391, 1389, 1388, 1243, 1242, 1385, 1384, 1238, 1100, 1098, 1097, 1232, 1094, 964]

So, we get stuck on the domino labelled with number 964.
It is at position (x, y) = (28, 4).

The gif:
This has been submitted to the OEIS as https://oeis.org/A357046

P.-S.
That said, I had already found a much longer knight's tour than Neil's, namely precisely that of https://oeis.org/A326924 (quite natural: minimizes the distance from the origin) which stops after 22325 jumps. Here is "plot":
- Maximilian
____________________
Magnifique – merci !

Commentaires

  1. Yes, if I'm not wrong, the knight gets stuck only after 2550 jumps, on the square at position (x,y) = (28, 4), labelled 964.

    RépondreSupprimer

Enregistrer un commentaire

Posts les plus consultés de ce blog

Beautés ?

Le tripalin se présente

Underline, reproduce