A274912 Square array read by antidiagonals upwards in which each new term is the least nonnegative integer distinct from its neighbors.
0, 1, 2, 0, 3, 0, 1, 2, 1, 2, 0, 3, 0, 3, 0, 1, 2, 1, 2, 1, 2, 0, 3, 0, 3, 0, 3, 0, 1, 2, 1, 2, 1, 2, 1, 2, 0, 3, 0, 3, 0, 3, 0, 3, 0, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2
Offset: 0
Examples
The corner of the square array begins: 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, ... 1, 3, 1, 3, 1, 3, 1, 3, 1, ... 0, 2, 0, 2, 0, 2, 0, 2, ... 1, 3, 1, 3, 1, 3, 1, ... 0, 2, 0, 2, 0, 2, ... 1, 3, 1, 3, 1, ... 0, 2, 0, 2, ... 1, 3, 1, ... 0, 2, ... 1, ... ... The sequence written as a triangle begins: 0; 1, 2; 0, 3, 0; 1, 2, 1, 2; 0, 3, 0, 3, 0; 1, 2, 1, 2, 1, 2; 0, 3, 0, 3, 0, 3, 0; 1, 2, 1, 2, 1, 2, 1, 2; 0, 3, 0, 3, 0, 3, 0, 3, 0; 1, 2, 1, 2, 1, 2, 1, 2, 1, 2; ...
Crossrefs
Programs
-
Maple
ListTools:-Flatten([seq([[0,3]$i,0,[1,2]$(i+1)],i=0..10)]); # Robert Israel, Nov 14 2016
-
Mathematica
Table[Boole@ EvenQ@ # + 2 Boole@ EvenQ@ k &[n - k + 1], {n, 14}, {k, n}] // Flatten (* Michael De Vlieger, Nov 14 2016 *)
Formula
a(n) = A274913(n) - 1.
From Robert Israel, Nov 14 2016: (Start)
G.f.: 3*x/(1-x^2) - Sum_{k>=0} (2*x^(2*k^2+3*k+1)-x^(2*k^2+5*k+3))/(1+x).
G.f. as triangle: x*(1+2*y+3*x*y)/((1-x^2*y^2)*(1-x^2)). (End)
Comments