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.

A384447 Array read by ascending antidiagonals: A(n, k) = gcd(n, k) if n > 0 otherwise 0.

Original entry on oeis.org

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

Views

Author

Peter Luschny, Jun 02 2025

Keywords

Comments

The set D = {A(n, k) : k >= 0} is a subset of [n] := {0, 1, 2,..., n} with the characteristic that for all d in D there exists a d' in D such that d*d'= n. Therefore, D may legitimately be called the 'set of divisors of n'.
However, this is not the standard definition from number theory textbooks, where an existential quantifier conjures up an infinite set out of nothing in the case n = 0. This view is also suggested by the characterization of the divisors of n as the fixed points of gcd on [n].
The form given here is constructive because it can be based on the Euclidean algorithm and with it the set of divisors is always finite.

Examples

			The array begins:
  [0] [0, 0, 0, 0, 0, 0, 0, 0, ...
  [1] [1, 1, 1, 1, 1, 1, 1, 1, ...
  [2] [2, 1, 2, 1, 2, 1, 2, 1, ...
  [3] [3, 1, 1, 3, 1, 1, 3, 1, ...
  [4] [4, 1, 2, 1, 4, 1, 2, 1, ...
  [5] [5, 1, 1, 1, 1, 5, 1, 1, ...
  [6] [6, 1, 2, 3, 2, 1, 6, 1, ...
  [7] [7, 1, 1, 1, 1, 1, 1, 7, ...
  [8] [8, 1, 2, 1, 4, 1, 2, 1, ...
  [9] [9, 1, 1, 3, 1, 1, 3, 1, ...
  ...
		

Crossrefs

Programs

  • Mathematica
    A[n_,k_]:=(1-KroneckerDelta[n,0])GCD[n,k]; Table[A[n-k,k],{n,0,12},{k,0,n}]//Flatten (* Stefano Spezia, Jun 02 2025 *)
  • Python
    from math import gcd
    def A(n, k): return gcd(n, k) if n > 0 else 0
    for n in range(10): print([A(n, k) for k in range(8)])

Formula

A(n, k) = A109004(n, k) for 0 <= k <= n.