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.

A051777 Triangle read by rows, where row (n) = n mod n, n mod (n-1), n mod (n-2), ...n mod 1.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 2, 1, 0, 0, 1, 2, 0, 0, 0, 0, 1, 2, 3, 1, 1, 0, 0, 1, 2, 3, 0, 2, 0, 0, 0, 1, 2, 3, 4, 1, 0, 1, 0, 0, 1, 2, 3, 4, 0, 2, 1, 0, 0, 0, 1, 2, 3, 4, 5, 1, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 0, 2, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 1, 3, 1, 1, 1, 0, 0, 1, 2, 3, 4, 5, 6, 0, 2, 4, 2, 2, 0, 0
Offset: 1

Views

Author

Asher Auel, Dec 09 1999

Keywords

Comments

Also, rectangular array read by antidiagonals, a(n, k) = k mod n (k >= 0, n >= 1). Cf. A048158, A051127. - David Wasserman, Oct 01 2008
Central terms: a(2*n - 1, n) = n - 1. - Reinhard Zumkeller, Jan 25 2011

Examples

			row (5) = 5 mod 5, 5 mod 4, 5 mod 3, 5 mod 2, 5 mod 1 = 0, 1, 2, 1, 0.
0 ;
0  0 ;
0  1  0 ;
0  1  0  0 ;
0  1  2  1  0;
0  1  2  0  0  0 ;
0  1  2  3  1  1  0 ;
0  1  2  3  0  2  0  0;
0  1  2  3  4  1  0  1  0 ;
0  1  2  3  4  0  2  1  0  0 ;
0  1  2  3  4  5  1  3  2  1  0 ;
0  1  2  3  4  5  0  2  0  0  0  0 ;
0  1  2  3  4  5  6  1  3  1  1  1  0 ;
		

Crossrefs

Cf. A051778. Row sums give A004125. Number of 0's in row n gives A000005 (tau(n)). Number of 1's in row n+1 gives A032741(n).

Programs

  • Haskell
    a051777 n k = a051777_row n !! (k-1)
    a051777_row n = map (mod n) [n, n-1 .. 1]
    a051777_tabl = map a051777_row [1..]
    -- Reinhard Zumkeller, Jan 25 2011
  • Mathematica
    Flatten[Table[Mod[n,Range[n,1,-1]],{n,20}]] (* Harvey P. Dale, Nov 30 2011 *)