A168313 Triangle read by rows, retain 1's as rightmost diagonal of A101688 and replace all other 1's with 2's.
1, 0, 1, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, 2, 1, 0, 0, 0, 2, 2, 1, 0, 0, 0, 2, 2, 2, 1, 0, 0, 0, 0, 2, 2, 2, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 1
Offset: 1
Examples
First few rows of the triangle = 1; 0, 1; 0, 2, 1; 0, 0, 2, 1; 0, 0, 2, 2, 1; 0, 0, 0, 2, 2, 1; 0, 0, 0, 2, 2, 2, 1; 0, 0, 0, 0, 2, 2, 2, 1; 0, 0, 0, 0, 2, 2, 2, 2, 1; 0, 0, 0, 0, 0, 2, 2, 2, 2, 1; 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 1; 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 1; ...
Links
- Boris Putievskiy, Transformations (of) Integer Sequences And Pairing Functions, arXiv:1212.2732 [math.CO], 2012.
Programs
-
Mathematica
rows = 11; A = Array[Which[#1 == 1, 1, #1 <= #2, 2, True, 0]&, {rows, rows}]; Table[A[[i-j+1, j]], {i, 1, rows}, {j, 1, i}] // Flatten (* Jean-François Alcover, Aug 08 2018 *)
Formula
Triangle read by rows, retain 1's as rightmost diagonal of A101688 and replace all other 1's with 2's.
From Boris Putievskiy, Jan 09 2013: (Start)
a(n) = 2*floor((2*n-t*(t+1)+1)/(t+3))*(n-t*(t+1)/2) - floor((sqrt(8*n+1)-1)/2) + t, where t = floor((-1+sqrt(8*n-7))/2). (End)
Comments