login
Triangle read by rows in which the n-th row contains n distinct numbers (not occurring earlier) such that every entry is coprime to its neighbor in all directions.
5

%I #15 Apr 07 2019 00:00:45

%S 1,2,3,5,7,4,6,11,9,13,17,19,8,23,10,12,25,21,29,27,31,37,41,16,43,14,

%T 47,15,18,35,33,53,39,59,22,49,61,67,26,71,20,73,45,79,24,28,51,55,57,

%U 77,83,32,89,65,97,95,101,46,103,34,69,85,63,38,81,40,36,91,75,107,109,113,44,127,115,119,121,87

%N Triangle read by rows in which the n-th row contains n distinct numbers (not occurring earlier) such that every entry is coprime to its neighbor in all directions.

%H Alois P. Heinz, <a href="/A082196/b082196.txt">Rows n = 1..141, flattened</a>

%e Triangle begins

%e 1;

%e 2, 3;

%e 5, 7, 4;

%e 6, 11, 9, 13;

%e 17, 19, 8, 23, 10;

%e ...

%e a(4,2) = 11. Its 8 neighbors are 5,7,4,9,8,19,17 and 6, which are coprime to 11.

%p ina:= proc() false end: mina:= 2:

%p T:= proc(n, k) option remember; global mina; local t;

%p if n<2 or k<1 or k>n then 1

%p else for t from mina while ina(t) or [1$4] <> map (x->igcd(x, t),

%p [T(n-1, k-1), T(n-1, k), T(n-1, k+1), T(n, k-1)])

%p do od; ina(t):= true;

%p while ina(mina) do mina:= mina+1 od;

%p t

%p fi

%p end:

%p seq (seq (T(n, k), k=1..n), n=1..15); # _Alois P. Heinz_, Sep 10 2011

%t ina[_] = False; mina = 2; T[n_, k_] := T[n, k] = If[n<2 || k<1 || k>n, 1, For[t = mina, ina[t] || Array[1&, 4] != Map [GCD[#, t]&, List[T[n-1, k-1], T[n-1, k], T[n-1, k+1], T[n, k-1]]], t++]; ina[t] = True; While[ina[mina], mina = mina+1]; t]; Table[Table[T[n, k], {k, 1, n}], {n, 1, 15}] // Flatten (* _Jean-François Alcover_, Mar 09 2015, after _Alois P. Heinz_ *)

%Y Cf. A082197, A082198, A082199.

%K nonn,tabl

%O 1,2

%A _Amarnath Murthy_, Apr 07 2003

%E More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 20 2003