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.

A274921 Spiral constructed on the nodes of the triangular net in which each new term is the least positive integer distinct from its neighbors.

This page as a plain text file.
%I A274921 #49 Sep 16 2017 03:45:51
%S A274921 1,2,3,2,3,2,3,1,3,1,2,1,3,1,2,1,3,1,2,3,2,1,2,3,1,3,2,1,2,3,1,3,2,1,
%T A274921 2,3,1,2,1,3,2,3,1,2,3,2,1,3,2,3,1,2,3,2,1,3,2,3,1,2,3,1,3,2,1,3,1,2,
%U A274921 3,1,2,1,3,2,1,3,1,2,3,1,2,1,3,2,1,3,1,2,3,1,2,3,2,1,3,2,1,2,3,1,2,3,1,3,2,1
%N A274921 Spiral constructed on the nodes of the triangular net in which each new term is the least positive integer distinct from its neighbors.
%C A274921 The structure of the spiral has the following properties:
%C A274921 1) Every 1 is surrounded by three equidistant 2's and three equidistant 3's.
%C A274921 2) Every 2 is surrounded by three equidistant 1's and three equidistant 3's.
%C A274921 3) Every 3 is surrounded by three equidistant 1's and three equidistant 2's.
%C A274921 4) Diagonals are periodic sequences with period 3 (A010882 and A130784).
%C A274921 From _Juan Pablo Herrera P._, Nov 16 2016: (Start)
%C A274921 5) Every hexagon with a 1 in its center is the same hexagon as the one in the middle of the spiral.
%C A274921 6) Every triangle whose number of numbers is divisible by 3 has the same number of 1's, 2's, and 3's. For example, a triangle with 6 numbers, has two 1's, two 2's, and two 3's. (End)
%C A274921 a(n) = a(n-2) if n > 2 is in A014591, otherwise a(n) = 6 - a(n-1)-a(n-2). - _Robert Israel_, Sep 15 2017
%H A274921 Robert Israel, <a href="/A274921/b274921.txt">Table of n, a(n) for n = 0..10000</a>
%F A274921 a(n) = A274920(n) + 1.
%e A274921 Illustration of initial terms as a spiral:
%e A274921 .
%e A274921 .                3 - 1 - 2 - 3 - 1 - 2
%e A274921 .               /                     \
%e A274921 .              1   2 - 3 - 1 - 2 - 3   1
%e A274921 .             /   /                 \   \
%e A274921 .            2   3   1 - 2 - 3 - 1   2   3
%e A274921 .           /   /   /             \   \   \
%e A274921 .          3   1   2   3 - 1 - 2   3   1   2
%e A274921 .         /   /   /   /         \   \   \   \
%e A274921 .        1   2   3   1   2 - 3   1   2   3   1
%e A274921 .       /   /   /   /   /     \   \   \   \   \
%e A274921 .      2   3   1   2   3   1 - 2   3   1   2   3
%e A274921 .       \   \   \   \   \         /   /   /   /
%e A274921 .        1   2   3   1   2 - 3 - 1   2   3   1
%e A274921 .         \   \   \   \             /   /   /
%e A274921 .          3   1   2   3 - 1 - 2 - 3   1   2
%e A274921 .           \   \   \                 /   /
%e A274921 .            2   3   1 - 2 - 3 - 1 - 2   3
%e A274921 .             \   \                     /
%e A274921 .              1   2 - 3 - 1 - 2 - 3 - 1
%e A274921 .               \
%e A274921 .                3 - 1 - 2 - 3 - 1 - 2
%e A274921 .
%p A274921 A[0]:= 1: A[1]:= 2: A[2]:= 3:
%p A274921 b:= 3: c:= 2: d:= 2: e:= 1: f:= 1:
%p A274921 for n from 3 to 200 do
%p A274921   if n = b then
%p A274921      r:= b; b:= c + d - f + 1; f:= e; e:= d; d:= c; c:= r;
%p A274921      A[n]:= A[n-2];
%p A274921   else
%p A274921      A[n]:= 6 - A[n-1] - A[n-2];
%p A274921   fi
%p A274921 od:
%p A274921 seq(A[i],i=0..200); # _Robert Israel_, Sep 15 2017
%Y A274921 Cf. A001399, A010882, A130784, A253186, A274820, A274821, A274920, A275606, A275610.
%K A274921 nonn
%O A274921 0,2
%A A274921 _Omar E. Pol_, Jul 11 2016