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.

A275161 Number of sides of a polygon formed by tiling n squares in a spiral.

Original entry on oeis.org

4, 4, 6, 4, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 6, 4, 6, 6, 6, 4, 6, 6, 6, 6, 4, 6, 6, 6, 6, 4, 6, 6, 6, 6, 6, 4, 6, 6, 6, 6, 6, 4, 6, 6, 6, 6, 6, 6, 4, 6, 6, 6, 6, 6, 6, 4, 6, 6, 6, 6, 6, 6, 6, 4, 6, 6, 6, 6, 6, 6, 6, 4, 6, 6, 6, 6, 6, 6, 6, 6, 4, 6, 6, 6, 6, 6, 6
Offset: 1

Views

Author

Eric Ginsburg, Nov 13 2016

Keywords

Examples

			From _Jon E. Schoenfield_, Nov 20 2016: (Start)
The order in which tiles are added to the spiral follows the numbering in the figure below:
.
  +----+----+----+----+----+
  | 25 | 10 | 11 | 12 | 13 |
  +----+----+----+----+----+
  | 24 |  9 |  2 |  3 | 14 |
  +----+----+----+----+----+
  | 23 |  8 |  1 |  4 | 15 |
  +----+----+----+----+----+
  | 22 |  7 |  6 |  5 | 16 |
  +----+----+----+----+----+
  | 21 | 20 | 19 | 18 | 17 |
  +----+----+----+----+----+
(End)
		

Crossrefs

Programs

  • Mathematica
    Table[If[Floor[Floor[Sqrt[4*n + 1]]^2/4] == n, 4, 6], {n, 1, 100}] (* Vaclav Kotesovec, Dec 02 2021 *)
  • PARI
    a(n)=if(sqrtint(4*n+1)^2\4==n, 4, 6) \\ Charles R Greathouse IV, Nov 20 2016

Formula

a(n) = 4 for n in A002620, 6 otherwise. - Jon E. Schoenfield, Nov 19 2016
a(n) = 6 - 2*A240025(n). [See above] - Antti Karttunen, Nov 30 2021