OFFSET
1,2
COMMENTS
This results in a triangle, where each element is coprime to all of its (at most eight) neighbors.
A rearrangement of nonprimes.
EXAMPLE
The first few rows of the triangle are
1;
4, 9;
25, 49, 8;
6, 121, 15, 77;
35, 169, 16, 221, 10;
12, 187, 21, 209, 27, 91;
T(4,2) = 121 is coprime to its neighbors 25, 49, 8, 6, 15, 35, 169 and 16.
PROG
(PARI) {unused(m, T, j, k)=b=1; for(jj=1, j-1, for(kk=1, jj, if(T[jj, kk]==m, b=0))); for(kk=1, k-1, if(T[j, kk]==m, b=0)); b}
(PARI) {nextnum(T, j, k)=t=1; m=4; while(t>0, if(!isprime(m)&&unused(m, T, j, k)&&if(k>1, gcd(m, T[j-1, k-1])==1, 1)&&if(k<j, gcd(m, T[j-1, k]), 1)==1&&if(k<j-1, gcd(m, T[j-1, k+1])==1, 1)&&if(k>1, gcd(m, T[j, k-1])==1, 1), t=0, m++)); m}
(PARI) {n=50; T=matrix(n, n); T[1, 1]=1; for(j=2, n, for(k=1, j, print1(T[j, k]=nextnum(T, j, k), ", "))); for(j=1, n, for(k=1, j, print1(T[j, k], ", ")))}
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Amarnath Murthy, Apr 07 2003
EXTENSIONS
Edited, corrected and extended by Klaus Brockhaus, May 14 2003
STATUS
approved