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.

A384446 Triangle read by rows: T(n, k) = |gcd(n, k) - k|.

Original entry on oeis.org

0, 1, 0, 2, 0, 0, 3, 0, 1, 0, 4, 0, 0, 2, 0, 5, 0, 1, 2, 3, 0, 6, 0, 0, 0, 2, 4, 0, 7, 0, 1, 2, 3, 4, 5, 0, 8, 0, 0, 2, 0, 4, 4, 6, 0, 9, 0, 1, 0, 3, 4, 3, 6, 7, 0, 10, 0, 0, 2, 2, 0, 4, 6, 6, 8, 0, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 12, 0, 0, 0, 0, 4, 0, 6, 4, 6, 8, 10, 0
Offset: 0

Views

Author

Peter Luschny, May 29 2025

Keywords

Comments

T(n, k) can be understood as a measure of the divisibility of n by k.

Examples

			Triangle starts:
  [0] [0]
  [1] [1, 0]
  [2] [2, 0, 0]
  [3] [3, 0, 1, 0]
  [4] [4, 0, 0, 2, 0]
  [5] [5, 0, 1, 2, 3, 0]
  [6] [6, 0, 0, 0, 2, 4, 0]
  [7] [7, 0, 1, 2, 3, 4, 5, 0]
  [8] [8, 0, 0, 2, 0, 4, 4, 6, 0]
  [9] [9, 0, 1, 0, 3, 4, 3, 6, 7, 0]
		

Crossrefs

Programs

  • Python
    from math import gcd
    print([abs(gcd(n, k) - k) for n in range(13) for k in range(n + 1)])

Formula

T(n, 0) = n.
T(n, k) = 0 if k divides n, in particular T(n, 1) = T(n, n) = 0.
T(n, k) = |A002262(n, k) - A109004(n, k)|.