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.

This page as a plain text file.
%I A051778 #19 Jul 18 2024 05:33:40
%S A051778 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,
%T A051778 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,
%U A051778 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
%N A051778 Triangle read by rows, where row (n) = n mod (n-1), n mod (n-2), n mod (n-3), ...n mod 2.
%C A051778 Central terms: a(2*n+1,n) = n for n > 0. - _Reinhard Zumkeller_, Dec 03 2014
%C A051778 Deleting column 1 of the array at A051126 gives the array A051778 in square format (see Example).   - _Clark Kimberling_, Feb 04 2016
%H A051778 Reinhard Zumkeller, <a href="/A051778/b051778.txt">Rows n=3..125 of triangle, flattened</a>
%e A051778 row (7) = 7 mod 6, 7 mod 5, 7 mod 4, 7 mod 3, 7 mod 2 = 1, 2, 3, 1, 1.
%e A051778 1;
%e A051778 1  0 ;
%e A051778 1  2  1 ;
%e A051778 1  2  0  0 ;
%e A051778 1  2  3  1  1 ;
%e A051778 1  2  3  0  2  0 ;
%e A051778 1  2  3  4  1  0  1 ;
%e A051778 1  2  3  4  0  2  1  0 ;
%e A051778 1  2  3  4  5  1  3  2  1 ;
%e A051778 1  2  3  4  5  0  2  0  0  0 ;
%e A051778 1  2  3  4  5  6  1  3  1  1  1 ;
%e A051778 Northwest corner of square array:
%e A051778 1 1 1 1 1 1 1 1 1 1 1
%e A051778 0 2 2 2 2 2 2 2 2 2 2
%e A051778 1 0 3 3 3 3 3 3 3 3 3
%e A051778 0 1 0 4 4 4 4 4 4 4 4
%e A051778 1 2 1 0 5 5 5 5 5 5 5
%e A051778 0 0 2 1 0 6 6 6 6 6 6
%e A051778 1 1 3 2 1 0 7 7 7 7 7
%e A051778 - _Clark Kimberling_, Feb 04 2016
%t A051778 Flatten[Table[Mod[n,i],{n,3,20},{i,n-1,2,-1}]] (* _Harvey P. Dale_, Sep 09 2012 *)
%t A051778 TableForm[Table[Mod[n, k], {n, 1, 12}, {k, 2, 12}]] (* square *)
%t A051778 (* _Clark Kimberling_, Feb 04 2016 *)
%o A051778 (Haskell)
%o A051778 a051778 n k = a051778_tabl !! (n-3) !! (k-1)
%o A051778 a051778_row n = a051778_tabl !! (n-3)
%o A051778 a051778_tabl = map (\xs -> map (mod (head xs + 1)) xs) $
%o A051778                    iterate (\xs -> (head xs + 1) : xs) [2]
%o A051778 -- _Reinhard Zumkeller_, Dec 03 2014
%Y A051778 Cf. A051777, A051127, A051126.
%Y A051778 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).
%K A051778 easy,nice,nonn,tabl
%O A051778 3,5
%A A051778 _Asher Auel_, Dec 09 1999