A049800 Triangular array T, read by rows: T(n,k) = (n+1) mod floor((k+1)/2), k = 1..n and n >= 1.
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 2, 2, 0, 0, 0, 1, 1, 2, 2, 3, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 4, 4, 2, 2, 0
Offset: 1
Examples
Array T(n,k) (with rows n >= 1 and columns k >= 1) begins as follows: 0; 0, 0; 0, 0, 0; 0, 0, 1, 1; 0, 0, 0, 0, 0; 0, 0, 1, 1, 1, 1; 0, 0, 0, 0, 2, 2, 0; 0, 0, 1, 1, 0, 0, 1, 1; 0, 0, 0, 0, 1, 1, 2, 2, 0; 0, 0, 1, 1, 2, 2, 3, 3, 1, 1; 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0; ...
Links
- G. C. Greubel, Rows n = 1..100 of triangle, flattened
Programs
-
GAP
Flat(List([1..15], n-> List([1..n], k-> (n+1) mod Int((k+1)/2) ))); # G. C. Greubel, Dec 09 2019
-
Magma
[ (n+1) mod Floor((k+1)/2): k in [1..n], n in [1..15]]; // G. C. Greubel, Dec 09 2019
-
Maple
# To get the sequence: seq(seq((n+1) mod floor((k+1)/2), k = 1..n), n = 1..30); # To get the triangular array: for n from 1 to 30 do seq((n+1) mod floor((k+1)/2), k = 1..n); end do; # Petros Hadjicostas, Nov 20 2019
-
Mathematica
Table[Mod[n+1, Floor[(k+1)/2]], {n,15}, {k,n}]//Flatten (* G. C. Greubel, Dec 09 2019 *)
-
PARI
T(n,k) = lift(Mod(n+1,(k+1)\2)); for(n=1, 15, for(k=1, n, print1(T(n,k), ", "))) \\ G. C. Greubel, Dec 09 2019
-
Sage
[[ mod(n+1, floor((k+1)/2)) for k in (1..n)] for n in (1..15)] # G. C. Greubel, Dec 09 2019
Extensions
Name edited by Petros Hadjicostas, Nov 20 2019