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.

A051194 Triangular array T read by rows: T(n,k) = number of positive integers that divide both n and k.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 2, 1, 3, 1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 4, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 2, 1, 4, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 2, 1, 2, 2, 2, 1, 2, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 3, 1, 4, 1, 3, 2, 2, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2
Offset: 1

Views

Author

Keywords

Comments

The function T(n,k) is defined for all integer n, k but only the values for 1<=k<=n as a triangular array are listed here.

Examples

			Triangle begins:
{1};
{1,2};
{1,1,2};
{1,2,1,3};
{1,1,1,1,2};
{1,2,2,2,1,4};
...
		

Crossrefs

Cf. A050873 (gcd), A000005 (number of divisors), A077478 (as square array).
Sum of numbers in row n matches A000203. Sum of numbers in first n rows matches A024916.

Programs

  • Mathematica
    T[ n_, k_] := Length[Intersection[Divisors @ If[n == 0, 1, n], Divisors @ If[k == 0, 1, k]]] (* Michael Somos, Jul 18 2011 *)
  • PARI
    {T(n, k) = sum( i=1, min( abs(n), abs(k)),(n%i == 0) && (k%i == 0))} /* Michael Somos, Jul 18 2011 */

Formula

T(n,k) = A000005(A050873(n,k)). - Reinhard Zumkeller, Jun 28 2010
T(n,k) = T(k,n) = T(-n,k) = T(n,-k) = T(n,n+k) = T(n+k,k). - Michael Somos, Jul 18 2011