cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

User: Simon S. Gurvets

Simon S. Gurvets's wiki page.

Simon S. Gurvets has authored 2 sequences.

A343540 Squares visited by a trapped knight on a square-spiral numbered board where the knight is shifted one square up and one square to the right after each move.

Original entry on oeis.org

1, 10, 7, 6, 5, 4, 3, 12, 13, 8, 9, 44, 45, 42, 41, 40, 39, 18, 17, 16, 15, 14, 11, 26, 27, 28, 29, 30, 31, 34, 33, 32, 35, 62, 61, 38, 37, 64, 63, 98, 97, 96, 95, 94, 93, 56, 53, 50, 47, 114, 73, 154, 109, 108, 107, 106, 105, 104, 103, 102
Offset: 1

Author

Simon S. Gurvets, Apr 18 2021

Keywords

Comments

The squares are numbered starting with 1 at the origin (0,0). The sequence is finite: when arriving on square number a(180) = 157, there is no free square within reach for the next move.
Shifting the knight only 1 square to the right leads to an infinite sequence. Similarly, shifting only 1 square up leads to an infinite sequence. More generally, if the knight jumps (1,n) spaces and is shifted m squares to the right, m > n leads to an infinite sequence.

A330008 Squares visited by a knight moving on a square-spiral numbered board where the knight moves to an unvisited square with the lowest prime spiral number, or lowest composite number if no primes are available.

Original entry on oeis.org

1, 10, 3, 6, 17, 4, 7, 2, 5, 8, 11, 14, 29, 32, 61, 16, 19, 22, 41, 18, 37, 62, 139, 60, 13, 28, 9, 12, 31, 54, 89, 30, 53, 26, 47, 76, 23, 20, 43, 70, 109, 42, 73, 44, 71, 40, 67, 36, 97, 34, 59, 56, 131, 88, 127, 52, 83, 80, 167, 82, 173, 84, 27, 24, 79, 46, 21, 72, 107
Offset: 1

Author

Simon S. Gurvets, Nov 26 2019

Keywords

Comments

The squares are numbered starting with 1 at the origin (0,0). The sequence is finite: when arriving on square number a(209) = 147, there is no free square within reach for the next move. - M. F. Hasler, Jan 26 2020

Crossrefs

Cf. A316667.

Programs

  • PARI
    local(U); my(v(p)=if(bittest(U,p),[9,0],[1-isprime(p+1),p]), nxt(x)=vecsort([v(pos(x+k))|k<-K])[1][2], K=[[(-1)^(i\2)<<(i>4),(-1)^i<<(i<5)]|i<-[1..8]], pos(x,y=x[2])=if(y>=abs(x=x[1]),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), xy(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]), A=List(0)); until(!listput(A,nxt(xy(A[#A]))), U+=1<A330008=[t+1|t<-A[^-1]] \\ M. F. Hasler, Jan 26 2020