OFFSET
1,2
COMMENTS
The board is numbered with the following walled, square spiral:
.
17 16 15 14 13 | .
------------- | .
18 | 5 4 3 |12 | .
| ----- | | .
19 | 6 | 1 2 |11 | .
| --------- | .
20 | 7 8 9 10 | .
----------------- .
21 22 23 24 25 26
.
The walls mark the boundary of the spiral.
A line drawn from the center of the starting square of a king move to the center of the ending square must pass through a wall. The king jumps over that wall. Some moves would just touch a wall without passing through the wall (e.g. 1 to 3). Such moves are not permissible.
The rules imply that the king cannot move from a square labeled k in the spiral to a square labeled k +- 1 or k +- 2.
Comment from M. F. Hasler, May 08 2025 (Start)
The sequence appears to be a permutation of the positive integers. The path drawn by Kevin Ryde shows the quasi-periodic structure of the trajectory and may lead to a formal proof.
However, it would be more natural to start the path at the origin, at a square labeled n = 0 (to which the king never moves). Then the sequence would conjecturally be a permutation of the nonnegative integers. This also leads to a more natural numbering for the squares in terms of the x,y coordinates - compare the Python function "square_number()". See A383185. (End) [Comment edited by N. J. A. Sloane, May 14 2025 following discussion with Kevin Ryde.]
LINKS
Sameer Khan, Table of n, a(n) for n = 1..100
Kevin Ryde, Path Plot
FORMULA
a(n) = A383185(n-1)+1. - M. F. Hasler, May 12 2025
EXAMPLE
For n = 2, a(2) = 4 because moving to 2 or 3 does not pass through a wall.
PROG
(Python)
def square_number(z): return int(4*y**2-y-x if (y := z.imag) >= abs(x := z.real)
else 4*x**2-x-y if -x>=abs(y) else (4*y-3)*y+x if -y>=abs(x) else (4*x-3)*x+y)
def A375925(n):
if not hasattr(A:=A375925, 'terms'): A.terms=[1]; A.pos=0
while len(A.terms) < n:
s, d = min((s, d) for d in (1, 1+1j, 1j, 1j-1, -1, -1-1j, -1j, 1-1j) if
abs((s:=1+square_number(A.pos+d))-A.terms[-1]) > 2 and s not in A.terms)
A.terms.append(s); A.pos += d
return A.terms[n-1] # M. F. Hasler, May 07 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Sameer Khan, Sep 03 2024
EXTENSIONS
Entry revised by N. J. A. Sloane, May 12 2025
STATUS
approved
