A104567 Triangle read by rows: T(i,j) = i-j+1 if j is odd; T(i,j) = 2(i-j+1) if j is even (1 <= j <= i).
1, 2, 2, 3, 4, 1, 4, 6, 2, 2, 5, 8, 3, 4, 1, 6, 10, 4, 6, 2, 2, 7, 12, 5, 8, 3, 4, 1, 8, 14, 6, 10, 4, 6, 2, 2, 9, 16, 7, 12, 5, 8, 3, 4, 1, 10, 18, 8, 14, 6, 10, 4, 6, 2, 2, 11, 20, 9, 16, 7, 12, 5, 8, 3, 4, 1, 12, 22, 10, 18, 8, 14, 6, 10, 4, 6, 2, 2, 13, 24, 11, 20, 9, 16, 7, 12, 5, 8, 3, 4, 1, 14
Offset: 1
Examples
The first few rows are: 1; 2, 2; 3, 4, 1; 4, 6, 2, 2;
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Maple
T:=proc(i,j) if j>i then 0 elif j mod 2 = 1 then i-j+1 elif j mod 2 = 0 then 2*(i-j+1) else fi end: for i from 1 to 14 do seq(T(i,j),j=1..i) od; # yields sequence in triangular form # Emeric Deutsch, Mar 24 2005
-
Mathematica
Table[If[OddQ[j],i-j+1,2(i-j+1)],{i,20},{j,i}]//Flatten (* Harvey P. Dale, Sep 03 2018 *)
Formula
T(i,j) = i-j+1 if j is odd; T(i,j) = 2(i-j+1) if j is even (1 <= j <= i). - Emeric Deutsch, Mar 24 2005
Extensions
More terms from Emeric Deutsch, Mar 24 2005
Comments