cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A048158 Triangular array T read by rows: T(n,k) = n mod k, for k=1,2,...,n, n=1,2,...

This page as a plain text file.
%I A048158 #51 Feb 16 2025 08:32:39
%S A048158 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 A048158 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 A048158 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 A048158 Triangular array T read by rows: T(n,k) = n mod k, for k=1,2,...,n, n=1,2,...
%C A048158 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 A048158 Alois P. Heinz, <a href="/A048158/b048158.txt">Rows n = 1..141, flattened</a>
%H A048158 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 A048158 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Mod.html">Mod</a>.
%F A048158 A051731(n,k) = A000007(T(n,k)). - _Reinhard Zumkeller_, Nov 01 2009
%F A048158 T(n,k) = n - k*A010766(n,k). - _Mats Granvik_, _Gary W. Adamson_, Feb 20 2010
%F A048158 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 A048158 Triangle begins
%e A048158   0;
%e A048158   0  0;
%e A048158   0  1  0;
%e A048158   0  0  1  0;
%e A048158   0  1  2  1  0;
%e A048158   0  0  0  2  1  0;
%e A048158   0  1  1  3  2  1  0;
%e A048158   0  0  2  0  3  2  1  0;
%e A048158   0  1  0  1  4  3  2  1  0;
%e A048158   0  0  1  2  0  4  3  2  1  0;
%e A048158   0  1  2  3  1  5  4  3  2  1  0;
%e A048158   0  0  0  0  2  0  5  4  3  2  1  0;
%e A048158   ...
%e A048158 From _Omar E. Pol_, Feb 21 2014: (Start)
%e A048158 Illustration of the 12th row of triangle:
%e A048158 -----------------------------------
%e A048158 .      k: 1 2 3 4 5 6 7 8 9 10..12
%e A048158 -----------------------------------
%e A048158 .         _ _ _ _ _ _ _ _ _ _ _ _
%e A048158 .        |_| | | | | | | | | | | |
%e A048158 .        |_|_| | | | | | | | | | |
%e A048158 .        |_| |_| | | | | | | | | |
%e A048158 .        |_|_| |_| | | | | | | | |
%e A048158 .        |_| | | |_| | | | | | | |
%e A048158 .        |_|_|_| | |_| | | | | | |
%e A048158 .        |_| | | | | |_| | | | | |
%e A048158 .        |_|_| |_| | |*|_| | | | |
%e A048158 .        |_| |_| | | |* *|_| | | |
%e A048158 .        |_|_| | |_| |* * *|_| | |
%e A048158 .        |_| | | |*| |* * * *|_| |
%e A048158 .        |_|_|_|_|*|_|* * * * *|_|
%e A048158 .
%e A048158 Row 12 is 0 0 0 0 2 0 5 4 3 2 1 0
%e A048158 (End)
%p A048158 T:= (n, k)-> modp(n, k):
%p A048158 seq(seq(T(n, k), k=1..n), n=1..20); # _Alois P. Heinz_, Apr 04 2012
%t A048158 Flatten[Table[Mod[n, Range[n]], {n, 15}]]
%o A048158 (Haskell)
%o A048158 a048158 = mod
%o A048158 a048158_row n = a048158_tabl !! (n-1)
%o A048158 a048158_tabl = zipWith (map . mod) [1..] a002260_tabl
%o A048158 -- _Reinhard Zumkeller_, Apr 29 2015, Jan 20 2014 (fixed), Aug 13 2013
%o A048158 (Python)
%o A048158 def A048158_T(n,k): return n%k # _Chai Wah Wu_, May 13 2024
%Y A048158 Row sums are given by A004125.
%Y A048158 Cf. A002260.
%Y A048158 Cf. A000007, A010766, A051126, A051127, A051731, A051777.
%K A048158 nonn,tabl
%O A048158 1,13
%A A048158 _Clark Kimberling_
%E A048158 More terms from _David Wasserman_, Oct 01 2008