login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A082025 Square array of distinct positive integers, in which neighboring entries (both orthogonal and diagonal) are coprime. The array is read by antidiagonals, alternating upwards and downwards. Each entry is the smallest positive integer not already used that is coprime to all of the neighboring entries that are earlier in the sequence. 4
1, 2, 3, 4, 5, 7, 6, 11, 13, 9, 8, 17, 12, 19, 23, 10, 29, 25, 31, 35, 27, 14, 37, 16, 41, 18, 43, 21, 20, 47, 49, 53, 15, 59, 55, 39, 22, 61, 24, 67, 26, 71, 30, 73, 33, 28, 79, 77, 83, 45, 89, 65, 97, 85, 57, 32, 91, 36, 101, 34, 103, 38, 107, 40, 109, 51, 44, 95, 63, 113 (list; table; graph; refs; listen; history; internal format)
OFFSET

1,2

EXAMPLE

1 2 7 6 23 10 ...

3 5 11 19 ...

4 13 12 ...

9 17 ...

8 ...

...

T(2,2) = 5 and its neighbors are 1, 2, 7, 11, 12, 13, 4 and 3, which are all coprime to 5.

MAPLE

iscoprime := proc(n, m) if gcd(n, m)=1 then RETURN(true); else RETURN(false); fi; end:

isin := proc(a, n, nmax) for row from 1 to nmax do for col from 1 to nmax do if a[row, col] = n then RETURN(true); end; od; od; RETURN(false); end:

iscoprMat := proc(a, candid, row, col, up) if not iscoprime(candid, a[row, col-1]) then RETURN(false); fi; if not iscoprime(candid, a[row-1, col]) then RETURN(false); fi; if not iscoprime(candid, a[row-1, col-1]) then RETURN(false); fi; if up then if not iscoprime(candid, a[row+1, col-1]) then RETURN(false); fi; else if not iscoprime(candid, a[row-1, col+1]) then RETURN(false); fi; fi; RETURN(true); end:

find := proc(a, row, col, nmax, up) for candid from 1 to 5000000 do if isin(a, candid, nmax) then next; fi; if not iscoprMat(a, candid, row, col, up) then next; fi; a[row, col] := candid; RETURN(a[row, col]); od; RETURN(-1); end:

nmax := 15; for row from 1 to nmax do for col from 1 to nmax do a[row, col] := -1; od : od : a[1, 1]:= 1 : up := false:

for dia from 2 to nmax do if up then for col from 1 to dia do row := dia+1-col; f := find(a, row, col, nmax, up); printf("%d, ", f); a[row, col] := f; od; else for row from 1 to dia do col := dia+1-row; f := find(a, row, col, nmax, up); printf("%d, ", f); a[row, col] := f; od; fi; up := not up : od : - R. J. Mathar (mathar(AT)strw.leidenuniv.nl), May 06 2006

CROSSREFS

Cf. A082187, A082188, A082189, A082190.

Sequence in context: A023826 A185969 A080688 * A076034 A034152 A114707

Adjacent sequences:  A082022 A082023 A082024 * A082026 A082027 A082028

KEYWORD

easy,nonn,tabl

AUTHOR

Amarnath Murthy (amarnath_murthy(AT)yahoo.com), Apr 07 2003

EXTENSIONS

Edited by David Wasserman (wasserma(AT)spawar.navy.mil), Aug 09 2004

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 15 08:45 EST 2012. Contains 205736 sequences.