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.

Showing 1-3 of 3 results.

A321446 Number of (0,1)-matrices with n ones, no zero rows or columns, and distinct rows and columns.

Original entry on oeis.org

1, 1, 2, 10, 72, 624, 6522, 80178, 1129368, 17917032, 316108752, 6138887616, 130120838400, 2989026225696, 73964789192400, 1961487062520720, 55495429438186920, 1668498596700706440, 53122020640948010640, 1785467619718933936560, 63175132023953553400440
Offset: 0

Views

Author

Gus Wiseman, Nov 13 2018

Keywords

Examples

			The a(3) = 10 matrices:
  [1 1] [1 1] [1 0] [0 1]
  [1 0] [0 1] [1 1] [1 1]
.
  [1 0 0] [1 0 0] [0 1 0] [0 1 0] [0 0 1] [0 0 1]
  [0 1 0] [0 0 1] [1 0 0] [0 0 1] [1 0 0] [0 1 0]
  [0 0 1] [0 1 0] [0 0 1] [1 0 0] [0 1 0] [1 0 0]
		

Crossrefs

Programs

  • Mathematica
    prs2mat[prs_]:=Table[Count[prs,{i,j}],{i,Union[First/@prs]},{j,Union[Last/@prs]}];
    Table[Length[Select[Subsets[Tuples[Range[n],2],{n}],And[Union[First/@#]==Range[Max@@First/@#],Union[Last/@#]==Range[Max@@Last/@#],UnsameQ@@prs2mat[#],UnsameQ@@Transpose[prs2mat[#]]]&]],{n,6}]
  • PARI
    \\ Q(m, n, wf) defined in A321588.
    seq(n)={my(R=vectorv(n,m,Q(m,n,w->1 + y^w + O(y*y^n)))); for(i=2, #R, R[i] -= i*R[i-1]); Vec(1 + vecsum(vecsum(R)))} \\ Andrew Howroyd, Jan 24 2024

Extensions

a(7) onwards from Andrew Howroyd, Jan 20 2024

A321588 Number of connected nonnegative integer matrices with sum of entries equal to n, no zero rows or columns, and distinct rows and columns.

Original entry on oeis.org

1, 1, 1, 9, 29, 181, 1285, 10635, 102355, 1118021, 13637175, 184238115, 2727293893, 43920009785, 764389610843, 14297306352937, 286014489487815, 6093615729757841, 137750602009548533, 3293082026520294529, 83006675263513350581, 2200216851785981586729, 61180266502369886181253
Offset: 0

Views

Author

Gus Wiseman, Nov 13 2018

Keywords

Comments

A matrix is connected if the positions in each row (or each column) of the nonzero entries form a connected hypergraph.

Examples

			The a(4) = 29 matrices:
4 31 13
.
3 21 21 20 12 12 11 110 11 110 101 101 1 10 10 02 011 011 01 01
1 10 01 11 10 01 20 101 02 011 110 011 3 21 12 11 110 101 21 12
.
11 11 10 10 01 01
10 01 11 01 11 10
01 10 01 11 10 11
		

Crossrefs

Programs

  • Mathematica
    prs2mat[prs_]:=Table[Count[prs,{i,j}],{i,Union[First/@prs]},{j,Union[Last/@prs]}];
    multsubs[set_,k_]:=If[k==0,{{}},Join@@Table[Prepend[#,set[[i]]]&/@multsubs[Drop[set,i-1],k-1],{i,Length[set]}]];
    csm[s_]:=With[{c=Select[Tuples[Range[Length[s]],2],And[OrderedQ[#],UnsameQ@@#,Length[Intersection@@s[[#]]]>0]&]},If[c=={},s,csm[Union[Append[Delete[s,List/@c[[1]]],Union@@s[[c[[1]]]]]]]]];
    Table[Length[Select[multsubs[Tuples[Range[n],2],n],And[Union[First/@#]==Range[Max@@First/@#],Union[Last/@#]==Range[Max@@Last/@#],UnsameQ@@prs2mat[#],UnsameQ@@Transpose[prs2mat[#]],Length[csm[Map[Last,GatherBy[#,First],{2}]]]==1]&]],{n,6}]
  • PARI
    permcount(v) = {my(m=1, s=0, k=0, t); for(i=1, #v, t=v[i]; k=if(i>1&&t==v[i-1], k+1, 1); m*=t*k; s+=t); s!/m}
    K(q,t,wf)={prod(j=1, #q, wf(t*q[j]))-1}
    Q(m,n,wf=w->2)={my(s=0); forpart(p=m, s+=(-1)^#p*permcount(p)*exp(-sum(t=1, n, (-1)^t*x^t*K(p,t,wf)/t, O(x*x^n))) ); Vec((-1)^m*serchop(serlaplace(s),1), -n)}
    ConnectedMats(M)={my([m, n]=matsize(M), R=matrix(m, n)); for(m=1, m, for(n=1, n, R[m, n] = M[m, n] - sum(i=1, m-1, sum(j=1, n-1, binomial(m-1, i-1)*binomial(n, j)*R[i, j]*M[m-i, n-j])))); R}
    seq(n)={my(R=vectorv(n,m,Q(m,n,w->1/(1 - y^w) + O(y*y^n)))); for(i=2, #R, R[i] -= i*R[i-1]); Vec(1 + vecsum( vecsum( Vec( ConnectedMats( Mat(R))))))} \\ Andrew Howroyd, Jan 24 2024

Extensions

a(7) onwards from Andrew Howroyd, Jan 24 2024

A380392 Irregular triangle read by rows: T(n,k) is the number of n X n binary matrices containing k South-East paths of 1's connecting the top left and bottom right corners.

Original entry on oeis.org

1, 1, 1, 13, 2, 1, 461, 26, 13, 8, 1, 2, 1, 61708, 1454, 953, 568, 325, 112, 178, 76, 22, 46, 48, 2, 16, 4, 4, 8, 8, 0, 1, 2, 1, 32348492, 340768, 279142, 168300, 125121, 44436, 81857, 24666, 25375, 28182, 19759, 4476, 17477, 4334, 7123, 6436, 4314, 1708, 5534
Offset: 0

Views

Author

John Tyler Rascoe, Jan 23 2025

Keywords

Comments

A South-East path of 1's in a binary matrix is a path of connected 1's with steps South (0,-1) and East (1,0). Here 1's are said to be connected if they are adjacent in the same row or column.
Conjecture: The average number of South-East paths of 1's in all n X n binary matrices is A001790(n-1)/A101926(n-1). - John Tyler Rascoe, Feb 21 2025

Examples

			Triangle begins:
     k=0   1   2  3  4  5  6
 n=0   1;
 n=1   1,  1;
 n=2  13,  2,  1;
 n=3 461, 26, 13, 8, 1, 2, 1;
 ...
For row n = 3 the possible South-East paths are:
 A.       B.       C.       D.       E.       F.
 [1 1 1]  [1 1 0]  [1 1 0]  [1 0 0]  [1 0 0]  [1 0 0]
 [0 0 1]  [0 1 1]  [0 1 0]  [1 1 1]  [1 1 0]  [1 0 0]
 [0 0 1]  [0 0 1]  [0 1 1]  [0 0 1]  [0 1 1]  [1 1 1]
The 3 X 3 matrix below does not contain any of the paths A-F so it is counted under T(3,0) = 461.
 [1 0 1]
 [1 1 1]
 [1 0 0]
The 3 X 3 matrix below contains paths A, B, and D so it is counted under T(3,3) = 8.
 [1 1 1]
 [1 1 1]
 [1 0 1]
		

Crossrefs

Cf. A000984 (row lengths), A001790, A002416 (row sums), A086266, A101926, A261242, A369285.

Programs

  • Python
    # see links
Showing 1-3 of 3 results.