A131225 Triangle read by rows: T(n,k) = 2*k - (1 + (-1)^(n-k))/2 (1 <= k <= n).
1, 2, 3, 1, 4, 5, 2, 3, 6, 7, 1, 4, 5, 8, 9, 2, 3, 6, 7, 10, 11, 1, 4, 5, 8, 9, 12, 13, 2, 3, 6, 7, 10, 11, 14, 15, 1, 4, 5, 8, 9, 12, 13, 16, 17, 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23
Offset: 1
Examples
First few rows of the triangle: 1; 2, 3; 1, 4, 5; 2, 3, 6, 7; 1, 4, 5, 8, 9; 2, 3, 6, 7, 10, 11; 1, 4, 5, 8, 9, 12, 13; ...
Programs
-
Maple
T := proc (n, k) options operator, arrow; 2*k-1/2-(1/2)*(-1)^(n-k) end proc: for n to 10 do seq(T(n, k), k = 1 .. n) end do; # yields sequence in triangular form - Emeric Deutsch, Jul 09 2007
-
Mathematica
T[n_,k_]:=2k-(1+(-1)^(n-k))/2;Table[T[n,k],{n,12},{k,n}]//Flatten (* James C. McMahon, Feb 17 2025 *)
Formula
Extensions
a(47), a(49) corrected and more terms from Georg Fischer, Jun 07 2023
Comments