%I #50 May 13 2024 18:40:23
%S 0,0,0,0,1,0,0,0,1,0,0,1,2,1,0,0,0,0,2,1,0,0,1,1,3,2,1,0,0,0,2,0,3,2,
%T 1,0,0,1,0,1,4,3,2,1,0,0,0,1,2,0,4,3,2,1,0,0,1,2,3,1,5,4,3,2,1,0,0,0,
%U 0,0,2,0,5,4,3,2,1,0,0,1,1,1,3,1,6,5,4,3,2,1,0,0,0,2,2,4,2,0,6,5,4,3,2,1,0
%N Triangular array T read by rows: T(n,k) = n mod k, for k=1,2,...,n, n=1,2,...
%C Also, rectangular array read by antidiagonals: a(n, k) = n mod k, n >= 0, k >= 1. Cf. A051126, A051127, A051777. - _David Wasserman_, Oct 01 2008
%H Alois P. Heinz, <a href="/A048158/b048158.txt">Rows n = 1..141, flattened</a>
%H Michael Z. Spivey, <a href="http://www.jstor.org/stable/30044176">The Humble Sum of Remainders Function</a>, Mathematics Magazine, Vol. 78, No. 4 (Oct., 2005), pp. 300-305.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Mod.html">Mod</a>.
%F A051731(n,k) = A000007(T(n,k)). - _Reinhard Zumkeller_, Nov 01 2009
%F T(n,k) = n - k*A010766(n,k). - _Mats Granvik_, _Gary W. Adamson_, Feb 20 2010
%F G.f. for the k-th column: x^(k+1)*Sum_{i=0..k-2} (i + 1)*x^i/(1 - x^k). - _Stefano Spezia_, May 08 2024
%e Triangle begins
%e 0;
%e 0 0;
%e 0 1 0;
%e 0 0 1 0;
%e 0 1 2 1 0;
%e 0 0 0 2 1 0;
%e 0 1 1 3 2 1 0;
%e 0 0 2 0 3 2 1 0;
%e 0 1 0 1 4 3 2 1 0;
%e 0 0 1 2 0 4 3 2 1 0;
%e 0 1 2 3 1 5 4 3 2 1 0;
%e 0 0 0 0 2 0 5 4 3 2 1 0;
%e ...
%e From _Omar E. Pol_, Feb 21 2014: (Start)
%e Illustration of the 12th row of triangle:
%e -----------------------------------
%e . k: 1 2 3 4 5 6 7 8 9 10..12
%e -----------------------------------
%e . _ _ _ _ _ _ _ _ _ _ _ _
%e . |_| | | | | | | | | | | |
%e . |_|_| | | | | | | | | | |
%e . |_| |_| | | | | | | | | |
%e . |_|_| |_| | | | | | | | |
%e . |_| | | |_| | | | | | | |
%e . |_|_|_| | |_| | | | | | |
%e . |_| | | | | |_| | | | | |
%e . |_|_| |_| | |*|_| | | | |
%e . |_| |_| | | |* *|_| | | |
%e . |_|_| | |_| |* * *|_| | |
%e . |_| | | |*| |* * * *|_| |
%e . |_|_|_|_|*|_|* * * * *|_|
%e .
%e Row 12 is 0 0 0 0 2 0 5 4 3 2 1 0
%e (End)
%p T:= (n, k)-> modp(n, k):
%p seq(seq(T(n, k), k=1..n), n=1..20); # _Alois P. Heinz_, Apr 04 2012
%t Flatten[Table[Mod[n, Range[n]], {n, 15}]]
%o (Haskell)
%o a048158 = mod
%o a048158_row n = a048158_tabl !! (n-1)
%o a048158_tabl = zipWith (map . mod) [1..] a002260_tabl
%o -- _Reinhard Zumkeller_, Apr 29 2015, Jan 20 2014 (fixed), Aug 13 2013
%o (Python)
%o def A048158_T(n,k): return n%k # _Chai Wah Wu_, May 13 2024
%Y Row sums are given by A004125.
%Y Cf. A002260.
%Y Cf. A000007, A010766, A051126, A051127, A051731, A051777.
%K nonn,tabl
%O 1,13
%A _Clark Kimberling_
%E More terms from _David Wasserman_, Oct 01 2008