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.

A278354 Number of neighbors of each new term in a square spiral.

This page as a plain text file.
%I A278354 #25 Nov 24 2016 09:42:14
%S A278354 0,1,2,3,2,3,2,4,3,2,4,3,2,4,4,3,2,4,4,3,2,4,4,4,3,2,4,4,4,3,2,4,4,4,
%T A278354 4,3,2,4,4,4,4,3,2,4,4,4,4,4,3,2,4,4,4,4,4,3,2,4,4,4,4,4,4,3,2,4,4,4,
%U A278354 4,4,4,3,2,4,4,4,4,4,4,4,3,2,4,4,4,4,4,4,4,3,2,4,4,4,4,4,4,4,4,3,2,4,4,4,4
%N A278354 Number of neighbors of each new term in a square spiral.
%C A278354 Here the "neighbors" of a(n) are defined to be the adjacent elements to a(n) in the same row, column or diagonals, that are present in the spiral when a(n) is the new element of the sequence in progress.
%C A278354 For the same idea but for a right triangle see A278317; for an isosceles triangle see A275015; for a square array see A278290; and for a hexagonal spiral see A047931.
%F A278354 From _Robert Israel_, Nov 22 2016: (Start)
%F A278354 a(n) = 3 if n>=4 is in A002620.
%F A278354 a(n) = 2 if n>=2 is in A033638.
%F A278354 Otherwise, a(n) = 4 if n > 2. (End)
%e A278354 Illustration of initial terms as a spiral (n = 1..169):
%e A278354 .
%e A278354 .     2 - 3 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 2
%e A278354 .     |                                               |
%e A278354 .     4   2 - 3 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 2   3
%e A278354 .     |   |                                       |   |
%e A278354 .     4   4   2 - 3 - 4 - 4 - 4 - 4 - 4 - 4 - 2   3   4
%e A278354 .     |   |   |                               |   |   |
%e A278354 .     4   4   4   2 - 3 - 4 - 4 - 4 - 4 - 2   3   4   4
%e A278354 .     |   |   |   |                       |   |   |   |
%e A278354 .     4   4   4   4   2 - 3 - 4 - 4 - 2   3   4   4   4
%e A278354 .     |   |   |   |   |               |   |   |   |   |
%e A278354 .     4   4   4   4   4   2 - 3 - 2   3   4   4   4   4
%e A278354 .     |   |   |   |   |   |       |   |   |   |   |   |
%e A278354 .     4   4   4   4   4   3   0 - 1   4   4   4   4   4
%e A278354 .     |   |   |   |   |   |           |   |   |   |   |
%e A278354 .     4   4   4   4   3   2 - 4 - 3 - 2   4   4   4   4
%e A278354 .     |   |   |   |   |                   |   |   |   |
%e A278354 .     4   4   4   3   2 - 4 - 4 - 4 - 3 - 2   4   4   4
%e A278354 .     |   |   |   |                           |   |   |
%e A278354 .     4   4   3   2 - 4 - 4 - 4 - 4 - 4 - 3 - 2   4   4
%e A278354 .     |   |   |                                   |   |
%e A278354 .     4   3   2 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 3 - 2   4
%e A278354 .     |   |                                           |
%e A278354 .     3   2 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 3 - 2
%e A278354 .     |
%e A278354 .     2 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 3
%e A278354 .
%p A278354 0,1,seq(op([2,4$floor(i/2),3]),i=0..30); # _Robert Israel_, Nov 22 2016
%Y A278354 Cf. A002620, A033638, A047931, A141481, A274917, A275015, A275609, A278180, A278290, A278317.
%K A278354 nonn
%O A278354 1,3
%A A278354 _Omar E. Pol_, Nov 19 2016