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.

A317612 For k >= 1, fill a k X k square with the numbers 1 to k^2 by rows left to right and top to bottom; then read the square by a square clockwise spiral beginning at the top left and spiraling inwards.

This page as a plain text file.
%I A317612 #17 Sep 14 2018 05:12:40
%S A317612 1,1,2,4,3,1,2,3,6,9,8,7,4,5,1,2,3,4,8,12,16,15,14,13,9,5,6,7,11,10,1,
%T A317612 2,3,4,5,10,15,20,25,24,23,22,21,16,11,6,7,8,9,14,19,18,17,12,13,1,2,
%U A317612 3,4,5,6,12,18,24,30,36,35,34,33,32,31,25,19,13,7,8,9,10,11,17,23,29,28,27,26,20,14,15,16,22,21,1,2,3,4,5,6,7,14,21,28,35,42,49,48,47,46,45,44,43
%N A317612 For k >= 1, fill a k X k square with the numbers 1 to k^2 by rows left to right and top to bottom; then read the square by a square clockwise spiral beginning at the top left and spiraling inwards.
%C A317612 Inspired by A317186.
%C A317612 The final term in the k X k spiral is A031878(k+1).
%e A317612   1 => 1;
%e A317612 .
%e A317612   1---2
%e A317612       |
%e A317612   3---4  =>  1, 2, 4, 3;
%e A317612 .
%e A317612   1---2---3
%e A317612           |
%e A317612   4---5   6
%e A317612   |       |
%e A317612   7---8---9  =>  1, 2, 3, 6, 9, 8, 7, 4, 5;
%e A317612 .
%e A317612    1---2---3---4
%e A317612                |
%e A317612    5---6---7   8
%e A317612    |       |   |
%e A317612    9  10--11  12
%e A317612    |           |
%e A317612   13--14--15--16
%e A317612 .
%e A317612   => 1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5, 6, 7, 11, 10;
%e A317612 .
%e A317612    1---2---3---4---5
%e A317612                    |
%e A317612    6---7---8---9  10
%e A317612    |           |   |
%e A317612   11  12--13  14  15
%e A317612    |   |       |   |
%e A317612   16  17--18--19  20
%e A317612    |               |
%e A317612   21--22--23--24--25
%e A317612 .
%e A317612   => 1, 2, 3, 4, 5, 10, 15, 20, 25, 24, 23, 22, 21, 16, 11, 6, 7, 8, 9, 14, 19, 18, 17, 12, 13;
%e A317612 .
%e A317612    1---2---3---4---5---6
%e A317612                        |
%e A317612    7---8---9--10--11  12
%e A317612    |               |   |
%e A317612   13  14--15--16  17  18
%e A317612    |   |       |   |   |
%e A317612   19  20  21--22  23  24
%e A317612    |   |           |   |
%e A317612   25  26--27--28--29  30
%e A317612    |                   |
%e A317612   31--32--33--34--35--36
%e A317612 .
%e A317612   => 1, 2, 3, 4, 5, 6, 12, 18, 24, 30, 36, 35, 34, 33, 32, 31, 25, 19, 13, 7, 8, 9, 10, 11, 17, 23, 29, 28, 27, 26, 20, 14, 15, 16, 22, 21;
%t A317612 (* To form an n X n square table which begins left to right, then top to bottom *) a[i_, j_, n_] := j + n*(i - 1); f[n_] := Table[ a[i, j, n], {i, n}, {j, n}]
%Y A317612 Cf. A031878, A317186.
%K A317612 easy,nonn
%O A317612 1,3
%A A317612 George E. Laham II and _Robert G. Wilson v_, Aug 01 2018