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.

A281726 Triangular array read by rows: T(n,k) is the number of elements in an n X k matrix that will be assigned the same value whether the integers from 1 to n*k are assigned to elements in row-major order or column-major order.

This page as a plain text file.
%I A281726 #35 Oct 19 2024 15:57:32
%S A281726 1,2,2,3,2,3,4,2,2,4,5,2,3,2,5,6,2,2,2,2,6,7,2,3,4,3,2,7,8,2,2,2,2,2,
%T A281726 2,8,9,2,3,2,5,2,3,2,9,10,2,2,4,2,2,4,2,2,10,11,2,3,2,3,6,3,2,3,2,11,
%U A281726 12,2,2,2,2,2,2,2,2,2,2,12,13,2,3,4,5,2,7,2,5,4,3,2,13
%N A281726 Triangular array read by rows: T(n,k) is the number of elements in an n X k matrix that will be assigned the same value whether the integers from 1 to n*k are assigned to elements in row-major order or column-major order.
%C A281726 From _Jon E. Schoenfield_, Dec 10 2023: (Start)
%C A281726 T(n,k) is also the number of lattice points that lie on a line segment from (0,0) to (n-k,k-1). Thus, row n of the triangle lists, for each of the n 1st-quadrant lattice points P whose Manhattan distance from the origin is n-1, the number of lattice points on a line segment from the origin to P.
%C A281726 E.g., for n = 5, the 5 1st-quadrant lattice points whose Manhattan distance from the origin is 4 are (0,4), (1,3), (2,2), (3,1), and (4,0), and a line segment drawn from the origin to each of these points will intersect 5, 2, 3, 2, and 5 lattice points, respectively; { 5, 2, 3, 2, 5 } is row 5 of the triangle. (End)
%H A281726 Alois P. Heinz, <a href="/A281726/b281726.txt">Rows n = 1..200, flattened</a>
%H A281726 Ana Rechtman, <a href="http://images-archive.math.cnrs.fr/Janvier-2017-3e-defi.html">3ème Défi du Calendrier Mathématique</a>, Images des Mathématiques, CNRS, January 2017.
%F A281726 T(n,k) = 1 + gcd(n-1, k-1). - _Jon E. Schoenfield_, Dec 08 2023
%e A281726 For n=3 and k=2, the matrix will be
%e A281726   1 2  and  1 4
%e A281726   3 4       2 5
%e A281726   5 6       3 6
%e A281726 and there are 2 identical terms (1 and 6).
%e A281726 Triangle begins:
%e A281726   1;
%e A281726   2, 2;
%e A281726   3, 2, 3;
%e A281726   4, 2, 2, 4;
%e A281726   5, 2, 3, 2, 5;
%e A281726   6, 2, 2, 2, 2, 6;
%e A281726   ...
%p A281726 T:= (n, k)-> add(add(`if`(j+k*(i-1)=i+n*(j-1), 1, 0), i=1..n), j=1..k):
%p A281726 seq(seq(T(n,k), k=1..n), n=1..20);  # _Alois P. Heinz_, Jan 28 2017
%t A281726 Array[1+GCD[#,Range[0,#]]&,20,0] (* _Paolo Xausa_, Dec 08 2023 *)
%o A281726 (PARI) a(n, k) = {ml = matrix(n, k, i, j, ((i-1)*k+j)); mc = matrix(n, k, i, j, ((j-1)*n+i)); sum(i=1, n, sum(j=1, k, ml[i,j] == mc[i,j]));}
%Y A281726 Cf. A109004, A281725.
%Y A281726 Main diagonal and column k=1 give A000027.
%K A281726 nonn,tabl
%O A281726 1,2
%A A281726 _Michel Marcus_, Jan 28 2017