login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A317620 Squares visited by a (2,4)-leaper on a spirally numbered board and moving to the lowest available unvisited square at each step. 3
1, 51, 13, 19, 25, 15, 21, 11, 17, 23, 53, 59, 129, 135, 61, 55, 125, 79, 161, 71, 77, 159, 153, 67, 141, 147, 69, 63, 137, 131, 233, 123, 165, 75, 157, 267, 73, 151, 65, 139, 57, 127, 81, 163, 277, 155, 265, 407, 145, 251, 389, 243, 237, 371, 229, 167 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Board is numbered with the 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 sequence is finite: at step 2016, square 8399 is visited, after which there are no unvisited squares within one move.

LINKS

Daniël Karssen, Table of n, a(n) for n = 1..2016

Daniël Karssen, Figure showing the first 29 steps of the sequence

Daniël Karssen, Figure showing the complete sequence

FORMULA

a(n) = A317619(n-1) + 1.

MATHEMATICA

spiral[n_] := Block[{o = 2 n - 1, t, w}, t = Table[0, {o}, {o}]; t = ReplacePart[t, {n, n} -> 1]; Do[w = Partition[Range[(2 (# - 1) - 1)^2 + 1, (2 # - 1)^2], 2 (# - 1)] &@ k; Do[t = ReplacePart[t, {(n + k) - (j + 1), n + (k - 1)} -> #[[1, j]]]; t = ReplacePart[t, {n - (k - 1), (n + k) - (j + 1)} -> #[[2, j]]]; t = ReplacePart[t, {(n - k) + (j + 1), n - (k - 1)} -> #[[3, j]]]; t = ReplacePart[t, {n + (k - 1), (n - k) + (j + 1)} -> #[[4, j]]], {j, 2 (k - 1)}] &@ w, {k, 2, n}]; t]; Block[{nn = 30, j = {2, 4}, k = 1, t}, t = spiral[nn]; (k - 1) + Nest[Function[{a}, Append[a, SelectFirst[Sort@ Map[{t[[##]], ##} & @@ {#1 + a[[-1, 2]], #2 + a[[-1, 3]]} & @@ # &, Join @@ Inner[Times, Tuples[{-1, 1}, {2}], Permutations[j], List]], FreeQ[a[[All, 1]], First[#] ] &]]], {{1, nn, nn}}, 55][[All, 1]] ] (* Michael De Vlieger, Aug 02 2018 *)

CROSSREFS

Cf. A317619, A317622.

Sequence in context: A087408 A255852 A160474 * A317415 A033371 A191514

Adjacent sequences:  A317617 A317618 A317619 * A317621 A317622 A317623

KEYWORD

nonn,fini,full

AUTHOR

Daniël Karssen, Aug 01 2018

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 26 05:51 EST 2020. Contains 332277 sequences. (Running on oeis4.)