login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A292678 Least number of symbols required to fill a grid of size n X n row by row in the greedy way such that in any row or column or rectangular 8 X 8 block no symbol occurs twice. 2
1, 4, 9, 16, 25, 36, 49, 64, 66, 66, 68, 68, 69, 69, 70, 70, 73, 76, 81, 84, 83, 82, 84, 79, 81, 83, 85, 85, 85, 85, 86, 88, 88, 92, 91, 88, 89, 92, 89, 93, 92, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 114, 114, 114, 114, 114, 114 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Consider the symbols as positive integers. By the greedy way we mean to fill the grid row by row from left to right always with the least possible positive integer such that the three constraints (on rows, columns and rectangular blocks) are satisfied.
In contrast to the sudoku case, the 8 X 8 rectangles have "floating" borders, so the constraint is actually equivalent to say that an element must be different from all neighbors in a Moore neighborhood of range 7 (having up to 15*15 = 225 grid points).
See sequences A292672, A292673, A292674 for examples.
LINKS
Eric Weisstein's World of Mathematics, Moore Neighborhood
PROG
(PARI) a(n, m=8, g=matrix(n, n))={my(ok(g, k, i, j, m)=if(m, ok(g[i, ], k)&&ok(g[, j], k)&&ok(concat(Vec(g[max(1, i-m+1)..i, max(1, j-m+1)..min(#g, j+m-1)])), k), !setsearch(Set(g), k))); for(i=1, n, for(j=1, n, for(k=1, n^2, ok(g, k, i, j, m)&&(g[i, j]=k)&&break))); vecmax(g)} \\ without "vecmax" the program returns the full n X n board.
(Python) # uses function in A292673
print([A292673(n, b=8) for n in range(1, 101)]) # Michael S. Branicky, Apr 13 2023
CROSSREFS
Sequence in context: A028907 A361265 A292677 * A072595 A334832 A169669
KEYWORD
nonn
AUTHOR
M. F. Hasler, Sep 20 2017
EXTENSIONS
Terms a(60) and beyond from Andrew Howroyd, Feb 22 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 20:33 EDT 2024. Contains 371916 sequences. (Running on oeis4.)