login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A278354 Number of neighbors of each new term in a square spiral. 6
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
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.
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.
LINKS
FORMULA
From Robert Israel, Nov 22 2016: (Start)
a(n) = 3 if n>=4 is in A002620.
a(n) = 2 if n>=2 is in A033638.
Otherwise, a(n) = 4 if n > 2. (End)
EXAMPLE
Illustration of initial terms as a spiral (n = 1..169):
.
. 2 - 3 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 2
. | |
. 4 2 - 3 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 2 3
. | | | |
. 4 4 2 - 3 - 4 - 4 - 4 - 4 - 4 - 4 - 2 3 4
. | | | | | |
. 4 4 4 2 - 3 - 4 - 4 - 4 - 4 - 2 3 4 4
. | | | | | | | |
. 4 4 4 4 2 - 3 - 4 - 4 - 2 3 4 4 4
. | | | | | | | | | |
. 4 4 4 4 4 2 - 3 - 2 3 4 4 4 4
. | | | | | | | | | | | |
. 4 4 4 4 4 3 0 - 1 4 4 4 4 4
. | | | | | | | | | | |
. 4 4 4 4 3 2 - 4 - 3 - 2 4 4 4 4
. | | | | | | | | |
. 4 4 4 3 2 - 4 - 4 - 4 - 3 - 2 4 4 4
. | | | | | | |
. 4 4 3 2 - 4 - 4 - 4 - 4 - 4 - 3 - 2 4 4
. | | | | |
. 4 3 2 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 3 - 2 4
. | | |
. 3 2 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 3 - 2
. |
. 2 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 4 - 3
.
MAPLE
0, 1, seq(op([2, 4$floor(i/2), 3]), i=0..30); # Robert Israel, Nov 22 2016
CROSSREFS
Sequence in context: A096737 A304535 A241856 * A165005 A167530 A205789
KEYWORD
nonn
AUTHOR
Omar E. Pol, Nov 19 2016
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 13 19:33 EDT 2024. Contains 375144 sequences. (Running on oeis4.)