A292677 Least number of symbols required to fill a grid of size n X n row by row in the greedy way such that in no row or column or 7 X 7 square any symbol occurs twice.
1, 4, 9, 16, 25, 36, 49, 51, 53, 56, 57, 59, 60, 60, 61, 62, 64, 66, 65, 64, 62, 62, 64, 66, 65, 67, 67, 67, 66, 67, 69, 67, 69, 69, 70, 70, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 75, 76, 78, 80, 80, 83, 82, 83, 87, 94, 99, 106, 107, 108, 109, 110, 111, 112, 112
Offset: 1
Keywords
Links
- Eric Weisstein's World of Mathematics, Moore Neighborhood
Programs
-
PARI
a(n,m=7,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=7) for n in range(1, 101)]) # Michael S. Branicky, Apr 13 2023
Extensions
Terms a(60) and beyond from Andrew Howroyd, Feb 22 2020
Comments