A292676 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 6 X 6 block no symbol occurs twice.
1, 4, 9, 16, 25, 36, 38, 38, 40, 40, 41, 41, 43, 45, 48, 48, 50, 49, 49, 49, 49, 50, 50, 51, 51, 52, 51, 52, 53, 53, 53, 53, 53, 53, 55, 53, 55, 55, 59, 59, 59, 61, 65, 64, 66, 70, 68, 69, 72, 73, 78, 78, 79, 84, 85, 85, 86, 90, 90, 90, 94, 93, 96, 97, 99, 102, 105, 106, 106, 107
Offset: 1
Keywords
Links
- Eric Weisstein's World of Mathematics, Moore Neighborhood
Programs
-
PARI
a(n,m=6,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=6) 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