cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A292674 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 4 X 4 block no symbol occurs twice.

This page as a plain text file.
%I A292674 #11 Feb 16 2025 08:33:51
%S A292674 1,4,9,16,18,18,20,20,22,22,23,23,23,24,25,26,26,26,29,32,32,34,36,38,
%T A292674 38,38,42,42,42,44,44,45,48,49,49,49,54,54,54,56,59,59,64,65,68,69,70,
%U A292674 73,76,78,79,79,82,82,83,86,87,89,90,92,95,95,96,96,97,97
%N A292674 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 4 X 4 block no symbol occurs twice.
%C A292674 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.
%C A292674 In contrast to the sudoku case, the 4 X 4 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 3 (having up to 7*7 = 49 grid points).
%H A292674 Andrew Howroyd, <a href="/A292674/b292674.txt">Table of n, a(n) for n = 1..100</a>
%H A292674 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/MooreNeighborhood.html">Moore Neighborhood</a>
%e A292674 For n = 8, the grid is filled as follows:
%e A292674   [ 1  2  3  4  5  6  7  8]
%e A292674   [ 5  6  7  8  1  2  3  4]
%e A292674   [ 9 10 11 12 13 14 15 16]
%e A292674   [13 14 15 16  9 10 11 12]
%e A292674   [ 2  3  4 17 18  5  6  7]
%e A292674   [ 6  1  8  7  2  3  4 17]
%e A292674   [10  5 12 19 20  1  8 13]
%e A292674   [11  9 13 14 10 15 12 19]
%e A292674 whence a(8) = 20.
%o A292674 (PARI) a(n,m=4,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.
%o A292674 (Python) # uses function in A292673
%o A292674 print([A292673(n, b=4) for n in range(1, 101)]) # _Michael S. Branicky_, Apr 13 2023
%Y A292674 Cf. A292670, A292671, A292672, ..., A292679.
%K A292674 nonn
%O A292674 1,2
%A A292674 _M. F. Hasler_, Sep 20 2017
%E A292674 Terms a(40) and beyond from _Andrew Howroyd_, Feb 22 2020