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.

A297934 Triangular array T(n, k), read by rows: least common prime factor of n and k, or 0 if n and k are coprime.

Original entry on oeis.org

0, 2, 0, 0, 0, 0, 2, 3, 2, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 2, 0, 0, 3, 0, 0, 3, 0, 0, 2, 0, 2, 5, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 2, 0, 2, 0, 2, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 2, 7, 2, 0, 2, 0, 2, 0, 0, 3, 0, 5, 3, 0, 0, 3, 5
Offset: 3

Views

Author

Felix Fröhlich, Jan 09 2018

Keywords

Comments

n is prime (A000040) if and only if Sum_{i=2..n-1} T(n, i) = 0.
n is a prime power (A025475) if and only if for any two x, y such that both T(n, x), T(n, y) > 0 also T(n, x) = T(n, y).

Examples

			============================================================
. n \ k |  2   3   4   5   6   7   8   9  10  11  12  13  14
--------|---------------------------------------------------
.   3   |  0
.   4   |  2   0
.   5   |  0   0   0
.   6   |  2   3   2   0
.   7   |  0   0   0   0   0
.   8   |  2   0   2   0   2   0
.   9   |  0   3   0   0   3   0   0
.  10   |  2   0   2   5   2   0   2   0
.  11   |  0   0   0   0   0   0   0   0   0
.  12   |  2   3   2   0   2   0   2   3   2   0
.  13   |  0   0   0   0   0   0   0   0   0   0   0
.  14   |  2   0   2   0   2   7   2   0   2   0   2   0
.  15   |  0   3   0   5   3   0   0   3   5   0   3   0   0
		

Crossrefs

Programs

  • Mathematica
    Table[If[CoprimeQ[n, k], 0, First@ Intersection[FactorInteger[n][[All, 1]], FactorInteger[k][[All, 1]] ]], {n, 3, 15}, {k, 2, n - 1}] // Flatten (* Michael De Vlieger, Jan 23 2018 *)
  • PARI
    t(n, k) = if(gcd(n, k) > 1, my(f=factor(n)[, 1]~, g=factor(k)[, 1]~); return(vecmin(setintersect(f, g)))); 0
    trianglerows(n) = for(x=3, n+2, for(y=2, x-1, print1(t(x, y), ", ")); print(""))
    trianglerows(13) \\ print upper 13 rows of triangle

Extensions

Value of T(12, 6) and PARI program corrected by Felix Fröhlich, Jan 23 2018