A307232 a(n) is the number of n X n {0,1}-matrices (over the reals) that contain no zeros when squared.
1, 1, 3, 73, 6003, 2318521, 4132876803
Offset: 0
Examples
For n = 2, the a(2) = 3 solutions are 1 1 0 1 1 1 1 0 1 1 1 1
Links
- Wikipedia, Logical matrix.
Crossrefs
Programs
-
MATLAB
%Exhaustively searches all matrices %from n = 1 to 5 result = zeros(1,5); for n = 1:5 for m = 0:2^(n^2)-1 p = fliplr(dec2bin(m,n^2) - '0'); M = reshape(p,[n n]); D = M^2; if(isempty(find(D==0, 1))) result(n) = result(n) + 1; end end end
-
Mathematica
a[n_] := Module[{b, iter, cnt = 0}, iter = Sequence @@ Table[{b[k], 0, 1}, {k, 1, n^2}]; Do[If[FreeQ[MatrixPower[Partition[Array[b, n^2], n], 2], 0], cnt++], iter // Evaluate]; cnt]; a[0] = 1; Do[Print[a[n]], {n, 0, 5}] (* Jean-François Alcover, Jun 23 2019 *)
Extensions
a(6) from Giovanni Resta, May 29 2019
Comments