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.

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

Original entry on oeis.org

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

Views

Author

Asher Auel, Dec 09 1999

Keywords

Comments

Central terms: a(2*n+1,n) = n for n > 0. - Reinhard Zumkeller, Dec 03 2014
Deleting column 1 of the array at A051126 gives the array A051778 in square format (see Example). - Clark Kimberling, Feb 04 2016

Examples

			row (7) = 7 mod 6, 7 mod 5, 7 mod 4, 7 mod 3, 7 mod 2 = 1, 2, 3, 1, 1.
1;
1  0 ;
1  2  1 ;
1  2  0  0 ;
1  2  3  1  1 ;
1  2  3  0  2  0 ;
1  2  3  4  1  0  1 ;
1  2  3  4  0  2  1  0 ;
1  2  3  4  5  1  3  2  1 ;
1  2  3  4  5  0  2  0  0  0 ;
1  2  3  4  5  6  1  3  1  1  1 ;
Northwest corner of square array:
1 1 1 1 1 1 1 1 1 1 1
0 2 2 2 2 2 2 2 2 2 2
1 0 3 3 3 3 3 3 3 3 3
0 1 0 4 4 4 4 4 4 4 4
1 2 1 0 5 5 5 5 5 5 5
0 0 2 1 0 6 6 6 6 6 6
1 1 3 2 1 0 7 7 7 7 7
- _Clark Kimberling_, Feb 04 2016
		

Crossrefs

Cf. A004125 (row sums), A000027 (central terms), A049820 (number of nonzeros per row), A032741 (number of ones per row), A070824 (number of zeros per row).

Programs

  • Haskell
    a051778 n k = a051778_tabl !! (n-3) !! (k-1)
    a051778_row n = a051778_tabl !! (n-3)
    a051778_tabl = map (\xs -> map (mod (head xs + 1)) xs) $
                       iterate (\xs -> (head xs + 1) : xs) [2]
    -- Reinhard Zumkeller, Dec 03 2014
  • Mathematica
    Flatten[Table[Mod[n,i],{n,3,20},{i,n-1,2,-1}]] (* Harvey P. Dale, Sep 09 2012 *)
    TableForm[Table[Mod[n, k], {n, 1, 12}, {k, 2, 12}]] (* square *)
    (* Clark Kimberling, Feb 04 2016 *)