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.

A353259 Solution to Snake Numbers Problems for Snakes from 1 to n for an n X n square grid (see Comments).

Original entry on oeis.org

1, 4, 7, 16, 19, 36, 39, 64, 67, 100
Offset: 1

Views

Author

Rodolfo Kurchan, Apr 08 2022

Keywords

Comments

On an n X n square board we draw a path with squares that we number 1, 2, ..., n, 1, 2, ..., n, 1, ... of the greatest length, which will be a(n). The path advances from one number to the next horizontally or vertically, not diagonally, after n it goes back to number 1. The path cannot cross itself. There cannot be repeated numbers in the same row or column.

Examples

			a(5) = 19 from Giorgio Vecchi:
  +---+---+---+---+---+
  |  2|  3|  4|  5|  1|
  +---+---+---+---+---+
  |  1|   |   |  3|  2|
  +---+---+---+---+---+
  |   |  1|  5|  4|   |
  +---+---+---+---+---+
  |  3|  2|   |   |  4|
  +---+---+---+---+---+
  |  4|  5|  1|  2|  3|
  +---+---+---+---+---+
.
a(7) = 39 from Giorgio Vecchi.
a(9) = 67 from Giorgio Vecchi.
For odd n >= 3 the solutions up to now have a(n) = (n-1)^2+3.
		

Formula

a(n) = n^2 for even n.