A274913 Square array read by antidiagonals upwards in which each new term is the least positive integer distinct from its neighbors.
1, 2, 3, 1, 4, 1, 2, 3, 2, 3, 1, 4, 1, 4, 1, 2, 3, 2, 3, 2, 3, 1, 4, 1, 4, 1, 4, 1, 2, 3, 2, 3, 2, 3, 2, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3
Offset: 1
Examples
The corner of the square array begins: 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, ... 2, 4, 2, 4, 2, 4, 2, 4, 2, ... 1, 3, 1, 3, 1, 3, 1, 3, ... 2, 4, 2, 4, 2, 4, 2, ... 1, 3, 1, 3, 1, 3, ... 2, 4, 2, 4, 2, ... 1, 3, 1, 3, ... 2, 4, 2, ... 1, 3, ... 2, ... ... The sequence written as a triangle begins: 1; 2, 3; 1, 4, 1; 2, 3, 2, 3; 1, 4, 1, 4, 1; 2, 3, 2, 3, 2, 3; 1, 4, 1, 4, 1, 4, 1; 2, 3, 2, 3, 2, 3, 2, 3; 1, 4, 1, 4, 1, 4, 1, 4, 1; 2, 3, 2, 3, 2, 3, 2, 3, 2, 3; ...
Programs
-
Mathematica
Table[1 + Boole@ EvenQ@ # + 2 Boole@ EvenQ@ k &[n - k + 1], {n, 14}, {k, n}] // Flatten (* Michael De Vlieger, Nov 14 2016 *)
Formula
a(n) = A274912(n) + 1.
Comments