OFFSET
1,1
COMMENTS
The formal definition is as follows:
Denote the triangle by [T(n,k), n >= 0, 0 <= k <= n]. Then T(0,0)=2;
for n>0, T(n,0) = smallest unused number m such that GCD(m,T(n-1,0)) > 1;
for n>0 and 1<=k<=n-1, T(n,k) = smallest unused number m such that GCD(m,T(n-1,k-1)) > 1, GCD(m,T(n-1,k))>1, and GCD(m, T(n,k-1))>1; and
for n>0, T(n,n) = smallest unused number m such that GCD(m,T(n-1,n-1)) > 1 and GCD(m, T(n,n-1))>1.
This is a kind of hybrid of the EKG sequence and Pascal's triangle.
It is conjectured that every number greater than 1 appears (cf. A397218).
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..20000
Michael S. Branicky, Table of n, a(n) for n = 1..10^6
Scott R. Shannon, Image of the first 1000 terms on the triangle. The number colors are graduated across the spectrum, from red to violet, to show their relative size.
Scott R. Shannon, Image of the first 100000 terms on the triangle.
EXAMPLE
Triangle begins:
2,
4, 6,
8, 10, 12,
14, 16, 18, 3,
7, 28, 20, 15, 9,
21, 35, 30, 5, 45, 24,
27, 42, 40, 25, 50, 36, 22,
33, 39, 26, 60, 55, 44, 32, 34,
11, 66, 48, 38, 70, 77, 56, 46, 52,
...
MATHEMATICA
Block[{c, k, t, u, rows}, rows = 12; c[_] := False; t[_, _] := 1; t[0, 0] = 2; c[2] = True; u = 3; {t[0, 0]}~Join~Reap[Do[k = u; Which[j == 0, While[Or[c[k], CoprimeQ[t[i - 1, 0], k] ], k++], j == i, While[Or[c[k], AnyTrue[{t[i, j - 1], t[i - 1, j - 1]}, CoprimeQ[#, k] &] ], k++], True, While[Or[c[k], AnyTrue[{t[i, j - 1], t[i - 1, j], t[i - 1, j - 1]}, CoprimeQ[#, k] &]], k++]]; Sow[Set[t[i, j], k] ]; c[k] = True; If[k == u, While[c[u], u++] ], {i, rows}, {j, 0, i}] ][[-1, 1]] ] (* Michael De Vlieger, Jun 19 2026 *)
PROG
(Python)
from math import gcd
from itertools import count, islice
def A397219_gen():
T, m, am, aset = {(0, 0): 2}, 3, 2, set()
for n in count(1):
for k in range(n+1):
yield am
aset.add(am)
if k == 0: neighs = {T[n-1, 0]}
elif 1 <= k < n: neighs = {T[n-1, k-1], T[n-1, k], T[n, k-1]}
else: neighs = {T[n-1, k-1], T[n, k-1]}
am = next(k for k in count(m) if k not in aset and all(gcd(v, k)>1 for v in neighs))
T[n, k] = am
print(list(islice(A397219_gen(), 68))) # Michael S. Branicky, Jun 19 2026
CROSSREFS
KEYWORD
AUTHOR
Scott R. Shannon, Jun 19 2026
EXTENSIONS
Edited by N. J. A. Sloane, Jun 19 2026
STATUS
approved
