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.

A337942 Table read by antidiagonals: T(n, k) is the least positive m such that (m*n) mod k = (m*k) mod n, with n > 0 and k > 0.

Original entry on oeis.org

1, 2, 2, 3, 1, 3, 4, 5, 5, 4, 5, 2, 1, 2, 5, 6, 3, 2, 2, 3, 6, 7, 3, 2, 1, 2, 3, 7, 8, 11, 2, 7, 7, 2, 11, 8, 9, 4, 17, 5, 1, 5, 17, 4, 9, 10, 5, 11, 13, 3, 3, 13, 11, 5, 10, 11, 5, 3, 2, 3, 1, 3, 2, 3, 5, 11, 12, 17, 7, 3, 28, 10, 10, 28, 3, 7, 17, 12
Offset: 1

Views

Author

Rémy Sigrist, Oct 01 2020

Keywords

Examples

			Array T(n, k) begins:
  n\k|  1   2   3   4   5   6   7   8   9  10
  ---+---------------------------------------
    1|  1   2   3   4   5   6   7   8   9  10
    2|  2   1   5   2   3   3  11   4   5   5
    3|  3   5   1   2   2   2  17  11   3   7
    4|  4   2   2   1   7   5  13   2   3   3
    5|  5   3   2   7   1   3   3  28  13   2
    6|  6   3   2   5   3   1  10   2   5   2
    7|  7  11  17  13   3  10   1   4   4  25
    8|  8   4  11   2  28   2   4   1  13   7
    9|  9   5   3   3  13   5   4  13   1   5
   10| 10   5   7   3   2   2  25   7   5   1
		

Crossrefs

Cf. A123684.

Programs

  • PARI
    T(n,k) = for (m=1, oo, if ((m*n)%k==(m*k)%n, return (m)))

Formula

T(n, k) = T(k, n) <= k*n.
T(n, n) = 1.
T(n, 1) = n.
T(n, n^2) = n.
T(n, n^3) = n^2.
T(n, n^k) = n^(k-1) for any k > 0.
T(n, n+1) = A123684(n+1) for any n > 2.