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-10 of 26 results. Next

A120733 Number of matrices with nonnegative integer entries and without zero rows or columns such that sum of all entries is equal to n.

Original entry on oeis.org

1, 1, 5, 33, 281, 2961, 37277, 546193, 9132865, 171634161, 3581539973, 82171451025, 2055919433081, 55710251353953, 1625385528173693, 50800411296363617, 1693351638586070209, 59966271207156833313, 2248276994650395873861, 88969158875611127548481
Offset: 0

Views

Author

Vladeta Jovovic, Aug 18 2006, Aug 21 2006

Keywords

Comments

The number of such matrices up to rows/columns permutations are given in A007716.
Dimensions of the graded components of the Hopf algebra MQSym (Matrix quasi-symmetric functions). - Jean-Yves Thibon (jyt(AT)univ-mlv.fr), Oct 23 2006
From Kyle Petersen, Aug 10 2016: (Start)
Number of cells in the two-sided Coxeter complex of the symmetric group. Inclusion of faces corresponds to refinement of matrices, see Section 6 of Petersen paper. The number of cells in the type B analog is given by A275787.
Also known as "two-way contingency tables" in the Diaconis-Gangolli reference. (End)

Examples

			a(2) = 5:
[1 0]   [0 1]   [1]   [1 1]   [2]
[0 1]   [1 0]   [1]
From _Gus Wiseman_, Nov 14 2018: (Start)
The a(3) = 33 matrices:
  [3][21][12][111]
.
  [2][20][11][11][110][101][1][10][10][100][02][011][01][01][010][001]
  [1][01][10][01][001][010][2][11][02][011][10][100][20][11][101][110]
.
  [1][10][10][10][100][100][01][01][010][01][010][001][001]
  [1][10][01][01][010][001][10][10][100][01][001][100][010]
  [1][01][10][01][001][010][10][01][001][10][100][010][100]
(End)
		

Crossrefs

Row sums of A261781.

Programs

  • Maple
    t1 := M -> add( add( add( (-1)^(n-j)*binomial(n, j)*((1-x)^(-j)-1)^m, j=0..n), n=0..M), m=0..M); s := series(t1(20),x,20); gfun[seriestolist](%); # N. J. A. Sloane, Jan 14 2009
  • Mathematica
    a[n_] := Sum[2^(-2-r-s)*Binomial[n+r*s-1, n], {r, 0, Infinity}, {s, 0, Infinity}]; Table[Print[an = a[n]]; an, {n, 0, 19}] (* Jean-François Alcover, May 15 2012, after Vladeta Jovovic *)
    Flatten[{1,Table[1/n!*Sum[(-1)^(n-k)*StirlingS1[n,k]*Sum[m!*StirlingS2[k, m],{m,k}]^2,{k,n}],{n,20}]}] (* Vaclav Kotesovec, May 07 2014 *)
    multsubs[set_,k_]:=If[k==0,{{}},Join@@Table[Prepend[#,set[[i]]]&/@multsubs[Drop[set,i-1],k-1],{i,Length[set]}]]; Table[Length[Select[multsubs[Tuples[Range[n],2],n],And[Union[First/@#]==Range[Max@@First/@#],Union[Last/@#]==Range[Max@@Last/@#]]&]],{n,5}] (* Gus Wiseman, Nov 14 2018 *)

Formula

a(n) = (1/n!)*Sum_{k=0..n} (-1)^(n-k)*Stirling1(n,k)*A000670(k)^2.
G.f.: Sum_{m>=0,n>=0} Sum_{j=0..n} (-1)^(n-j)*C(n,j)*((1-x)^(-j)-1)^m.
a(n) = Sum_{r>=0,s>=0} binomial(r*s+n-1,n)/2^(r+s+2).
G.f.: Sum_{n>=0} 1/(2-(1-x)^(-n))/2^(n+1). - Vladeta Jovovic, Oct 30 2006
a(n) ~ 2^(log(2)/2-2) * n! / (log(2))^(2*n+2). - Vaclav Kotesovec, May 07 2014

Extensions

More terms from N. J. A. Sloane, Jan 14 2009

A138178 Number of symmetric matrices with nonnegative integer entries and without zero rows or columns such that sum of all entries is equal to n.

Original entry on oeis.org

1, 1, 3, 9, 33, 125, 531, 2349, 11205, 55589, 291423, 1583485, 8985813, 52661609, 319898103, 2000390153, 12898434825, 85374842121, 580479540219, 4041838056561, 28824970996809, 210092964771637, 1564766851282299, 11890096357039749, 92151199272181629
Offset: 0

Views

Author

Vladeta Jovovic, Mar 03 2008

Keywords

Comments

Number of normal semistandard Young tableaux of size n, where a tableau is normal if its entries span an initial interval of positive integers. - Gus Wiseman, Feb 23 2018

Examples

			a(4) = 33 because there are 1 such matrix of type 1 X 1, 7 matrices of type 2 X 2, 15 of type 3 X 3 and 10 of type 4 X 4, cf. A138177.
From _Gus Wiseman_, Feb 23 2018: (Start)
The a(3) = 9 normal semistandard Young tableaux:
1   1 2   1 3   1 2   1 1   1 2 3   1 2 2   1 1 2   1 1 1
2   3     2     2     2
3
(End)
From _Gus Wiseman_, Nov 14 2018: (Start)
The a(4) = 33 matrices:
[4]
.
[30][21][20][11][10][02][01]
[01][10][02][11][03][20][12]
.
[200][200][110][101][100][100][100][100][011][010][010][010][001][001][001]
[010][001][100][010][020][011][010][001][100][110][101][100][020][010][001]
[001][010][001][100][001][010][002][011][100][001][010][002][100][101][110]
.
[1000][1000][1000][1000][0100][0100][0010][0010][0001][0001]
[0100][0100][0010][0001][1000][1000][0100][0001][0100][0010]
[0010][0001][0100][0010][0010][0001][1000][1000][0010][0100]
[0001][0010][0001][0100][0001][0010][0001][0100][1000][1000]
(End)
		

Crossrefs

Programs

  • Maple
    gf:= proc(j) local k, n; add(add((-1)^(n-k) *binomial(n, k) *(1-x)^(-k) *(1-x^2)^(-binomial(k, 2)), k=0..n), n=0..j) end: a:= n-> coeftayl(gf(n+1), x=0, n): seq(a(n), n=0..25); # Alois P. Heinz, Sep 25 2008
  • Mathematica
    Table[Sum[SeriesCoefficient[1/(2^(k+1)*(1-x)^k*(1-x^2)^(k*(k-1)/2)),{x,0,n}],{k,0,Infinity}],{n,0,20}]  (* Vaclav Kotesovec, Jul 03 2014 *)
    multsubs[set_,k_]:=If[k==0,{{}},Join@@Table[Prepend[#,set[[i]]]&/@multsubs[Drop[set,i-1],k-1],{i,Length[set]}]]; Table[Length[Select[multsubs[Tuples[Range[n],2],n],And[Union[First/@#]==Range[Max@@First/@#],Union[Last/@#]==Range[Max@@Last/@#],Sort[Reverse/@#]==#]&]],{n,5}] (* Gus Wiseman, Nov 14 2018 *)

Formula

G.f.: Sum_{n>=0} Sum_{k=0..n} (-1)^(n-k)*C(n,k)*(1-x)^(-k)*(1-x^2)^(-C(k,2)).
G.f.: Sum_{n>=0} 2^(-n-1)*(1-x)^(-n)*(1-x^2)^(-C(n,2)). - Vladeta Jovovic, Dec 09 2009

Extensions

More terms from Alois P. Heinz, Sep 25 2008

A321719 Number of non-normal semi-magic squares with sum of entries equal to n.

Original entry on oeis.org

1, 1, 3, 7, 28, 121, 746, 5041, 40608, 362936, 3635017, 39916801, 479206146, 6227020801, 87187426839, 1307674521272, 20923334906117, 355687428096001, 6402415241245577, 121645100408832001, 2432905938909013343, 51090942176372298027, 1124001180562929946213
Offset: 0

Views

Author

Gus Wiseman, Nov 18 2018

Keywords

Comments

A non-normal semi-magic square is a nonnegative integer matrix with row sums and column sums all equal to d, for some d|n.
Squares must be of size k X k where k is a divisor of n. This implies that a(p) = p! + 1 for p prime since the only allowable squares are of sizes 1 X 1 and p X p. The 1 X 1 square is [p], the p X p squares are necessarily permutation matrices and there are p! permutation matrices of size p X p. Also, a(n) >= n! + 1 for n > 1. - Chai Wah Wu, Jan 13 2019

Examples

			The a(3) = 7 semi-magic squares:
  [3]
.
  [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]}];
    multsubs[set_,k_]:=If[k==0,{{}},Join@@Table[Prepend[#,set[[i]]]&/@multsubs[Drop[set,i-1],k-1],{i,Length[set]}]];
    Table[Length[Select[multsubs[Tuples[Range[n],2],n],And[Union[First/@#]==Range[Max@@First/@#]==Union[Last/@#],SameQ@@Total/@prs2mat[#],SameQ@@Total/@Transpose[prs2mat[#]]]&]],{n,5}]

Formula

a(p) = p! + 1 for p prime and a(n) >= n! + 1 for n > 1 (see comment above). - Chai Wah Wu, Jan 13 2019
a(n) = Sum_{d|n} A257493(d, n/d) for n > 0. - Andrew Howroyd, Apr 11 2020

Extensions

a(7) from Chai Wah Wu, Jan 13 2019
a(6) corrected and a(8)-a(15) added by Chai Wah Wu, Jan 14 2019
a(16)-a(19) from Chai Wah Wu, Jan 16 2019
Terms a(20) and beyond from Andrew Howroyd, Apr 11 2020

A104602 Number of square (0,1)-matrices with exactly n entries equal to 1 and no zero row or columns.

Original entry on oeis.org

1, 1, 2, 10, 70, 642, 7246, 97052, 1503700, 26448872, 520556146, 11333475922, 270422904986, 7016943483450, 196717253145470, 5925211960335162, 190825629733950454, 6543503207678564364, 238019066600097607402, 9153956822981328930170, 371126108428565106918404
Offset: 0

Views

Author

Ralf Stephan, Mar 27 2005

Keywords

Comments

Number of square (0,1)-matrices with exactly n entries equal to 1 and no zero row or columns, up to row and column permutation, is A057151(n). - Vladeta Jovovic, Mar 25 2006

Examples

			From _Gus Wiseman_, Nov 14 2018: (Start)
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]
(End)
		

Crossrefs

Programs

  • Mathematica
    Table[1/n!*Sum[StirlingS1[n,k]*Sum[(m!)^2*StirlingS2[k, m]^2, {m, 0, k}],{k,0,n}],{n,1,20}] (* Vaclav Kotesovec, May 07 2014 *)
    Table[Length[Select[Subsets[Tuples[Range[n],2],{n}],Union[First/@#]==Union[Last/@#]==Range[Max@@First/@#]&]],{n,5}] (* Gus Wiseman, Nov 14 2018 *)

Formula

a(n) = (1/n!)*Sum_{k=0..n} Stirling1(n,k)*A048144(k). - Vladeta Jovovic, Mar 25 2006
G.f.: Sum_{n>=0} Sum_{j=0..n} (-1)^(n-j)*binomial(n,j)*((1+x)^j-1)^n. - Vladeta Jovovic, Mar 25 2006
a(n) ~ c * n! / (sqrt(n) * (log(2))^(2*n)), where c = 0.28889864564457451375789435201798... . - Vaclav Kotesovec, May 07 2014
In closed form, c = 1 / (log(2) * 2^(log(2)/2+2) * sqrt(Pi*(1-log(2)))). - Vaclav Kotesovec, May 03 2015
G.f.: Sum_{n>=0} ((1+x)^n - 1)^n / (1+x)^(n*(n+1)). - Paul D. Hanna, Mar 26 2018

Extensions

More terms from Vladeta Jovovic, Mar 25 2006
a(0)=1 prepended by Alois P. Heinz, Jan 14 2015

A048144 a(n) = Sum_{k=0..n} (k!)^2 * Stirling_2(n,k)^2.

Original entry on oeis.org

1, 1, 5, 73, 2069, 95401, 6487445, 610093513, 75796724309, 12020754177001, 2369364111428885, 568128719132038153, 162835627057766030549, 54975855375379966645801, 21593185551426744571090325, 9762238510837560633366673993, 5033241437347149354018370856789
Offset: 0

Views

Author

Keywords

Comments

Number of digraphs with loops, with labeled vertices and labeled arcs, with n arcs and with no vertex of indegree 0 or outdegree 0, cf. A121936, A122418, A122399. - Vladeta Jovovic, Sep 06 2006
Chromatic invariant of the complete bipartite graph K_{n+1,n+1}. - Eric W. Weisstein, Jul 11 2011
Generally, for p >= 1, Sum_{k=0..n} (k!*StirlingS2(n,k))^p is asymptotic to n^(p*n+1/2) * sqrt(Pi/(2*p*(1-log(2))^(p-1))) / (exp(p*n) * log(2)^(p*n+1)). - Vaclav Kotesovec, May 10 2014

Crossrefs

Programs

  • Maple
    a := proc(n) local A, j; A := proc(n, k) option remember; if n = 0 then n^k else add(binomial(k + `if`(j>0, 1, 0), j+1) * A(n-1, k-j), j = 0..k) fi end: A(n,n) end:
    seq(a(n), n = 0..16);  # Peter Luschny, Nov 20 2024
  • Mathematica
    Table[Sum[(k!)^2*StirlingS2[n,k]^2,{k,0,n}],{n,0,20}] (* Vaclav Kotesovec, May 07 2014 *)
  • PARI
    a(n) = sum(k=0, n, k!^2*stirling(n, k, 2)^2); \\ Michel Marcus, Mar 07 2020
    
  • Python
    from functools import cache
    from math import comb as binomial
    @cache
    def A(n, k): return int(k == 0) if n == 0 else sum(binomial(k + int(j > 0), j + 1) * A(n - 1, k - j) for j in range(k + 1))
    a = lambda n: A(n, n)
    print([a(n) for n in range(17)])  # Peter Luschny, Nov 20 2024

Formula

E.g.f.: Sum_{n>=0} Sum_{j=0..n} (-1)^(n-j)*binomial(n,j)*(exp(j*x)-1)^n. a(n) = Sum_{k=0..n} Stirling2(n,k)*k!*A104602(k). - Vladeta Jovovic, Mar 25 2006
a(n) ~ sqrt(Pi/(1-log(2))) * n^(2*n+1/2) / (2*exp(2*n) * (log(2))^(2*n+1)). - Vaclav Kotesovec, May 09 2014
E.g.f.: Sum_{n>=0} (1 - exp(-n*x))^n * exp(-n*x). - Paul D. Hanna, Mar 26 2018
E.g.f.: Sum_{n>=0} (exp(n*x) - 1)^n * exp(-n*(n+1)*x). - Paul D. Hanna, Mar 26 2018
a(n) = A272644(2n,n). - Alois P. Heinz, Oct 17 2024
a(n) = A371761(n, n). - Peter Luschny, Nov 20 2024
a(n) = (n!)^2 * [(x*y)^n] 1 / (exp(x) + exp(y) - exp(x + y)). - Ilya Gutkovskiy, Apr 24 2025

A057151 Number of square binary matrices with n ones, with no zero rows or columns, up to row and column permutation.

Original entry on oeis.org

1, 1, 2, 4, 8, 18, 41, 102, 252, 666, 1789, 5031, 14486, 43280, 132777, 420267, 1366307, 4566966, 15661086, 55081118, 198425478, 731661754, 2758808581, 10629386376, 41814350148, 167830018952, 686822393793, 2864024856054, 12162059027416, 52564545391789
Offset: 1

Views

Author

Vladeta Jovovic, Aug 14 2000

Keywords

Comments

Number of square binary matrices with n ones and with no zero rows or columns is A104602(n). - Vladeta Jovovic, Mar 25 2006
Also the number of non-isomorphic square set multipartitions (multisets of sets) of weight n. A multiset partition or hypergraph is square if its length (number of blocks or edges) is equal to its number of vertices. The weight of a multiset partition is the sum of sizes of its parts. - Gus Wiseman, Nov 16 2018

Examples

			There are 666 square binary matrices with 10 ones, with no zero rows or columns, up to row and column permutation: 33 of size 4 X 4, 248 of size 5 X 5, 288 of size 6 X 6, 79 of size 7 X 7, 15 of size 8 X 8, 2 of size 9 X 9 and 1 of size 10 X 10. Cf. A057150.
From _Gus Wiseman_, Nov 16 2018: (Start)
Non-isomorphic representatives of the a(1) = 1 through a(6) = 18 square set multipartitions:
  {1}  {1}{2}  {2}{12}    {12}{12}      {1}{23}{23}      {12}{13}{23}
               {1}{2}{3}  {1}{1}{23}    {2}{13}{23}      {1}{23}{123}
                          {1}{3}{23}    {2}{3}{123}      {13}{23}{23}
                          {1}{2}{3}{4}  {3}{13}{23}      {3}{23}{123}
                                        {3}{3}{123}      {1}{1}{1}{234}
                                        {1}{2}{2}{34}    {1}{1}{24}{34}
                                        {1}{2}{4}{34}    {1}{1}{4}{234}
                                        {1}{2}{3}{4}{5}  {1}{2}{34}{34}
                                                         {1}{3}{24}{34}
                                                         {1}{3}{4}{234}
                                                         {1}{4}{24}{34}
                                                         {1}{4}{4}{234}
                                                         {2}{4}{12}{34}
                                                         {3}{4}{12}{34}
                                                         {4}{4}{12}{34}
                                                         {1}{2}{3}{3}{45}
                                                         {1}{2}{3}{5}{45}
                                                         {1}{2}{3}{4}{5}{6}
(End)
		

Crossrefs

Extensions

More terms from Max Alekseyev, May 31 2007

A319899 Numbers whose number of prime factors with multiplicity (A001222) is the number of distinct prime factors (A001221) in the product of the prime indices (A003963).

Original entry on oeis.org

1, 3, 5, 7, 11, 15, 17, 19, 23, 26, 31, 33, 35, 39, 41, 51, 53, 55, 58, 59, 65, 67, 69, 74, 77, 83, 85, 86, 87, 91, 93, 94, 95, 97, 103, 109, 111, 119, 122, 123, 127, 129, 131, 142, 146, 155, 157, 158, 161, 165, 169, 177, 178, 179, 183, 185, 187, 191, 201, 202
Offset: 1

Views

Author

Gus Wiseman, Dec 17 2018

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798. The multiset multisystem with MM-number n is formed by taking the multiset of prime indices of each part of the multiset of prime indices of n. For example, the prime indices of 78 are {1,2,6}, so the multiset multisystem with MM-number 78 is {{},{1},{1,2}}. This sequence lists all MM-numbers of square multiset multisystems, meaning the number of edges is equal to the number of distinct vertices.

Examples

			The sequence of multiset multisystems whose MM-numbers belong to the sequence begins:
   1: {}
   3: {{1}}
   5: {{2}}
   7: {{1,1}}
  11: {{3}}
  15: {{1},{2}}
  17: {{4}}
  19: {{1,1,1}}
  23: {{2,2}}
  26: {{},{1,2}}
  31: {{5}}
  33: {{1},{3}}
  35: {{2},{1,1}}
  39: {{1},{1,2}}
  41: {{6}}
  51: {{1},{4}}
  53: {{1,1,1,1}}
  55: {{2},{3}}
  58: {{},{1,3}}
  59: {{7}}
  65: {{2},{1,2}}
  67: {{8}}
  69: {{1},{2,2}}
  74: {{},{1,1,2}}
		

Crossrefs

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[100],PrimeOmega[#]==PrimeNu[Times@@primeMS[#]]&]

A321721 Number of non-isomorphic non-normal semi-magic square multiset partitions of weight n.

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 7, 2, 10, 7, 12, 2, 38, 2, 21, 46, 72, 2, 162, 2, 420, 415, 64, 2, 4987, 1858, 110, 9336, 45456, 2, 136018, 2, 1014658, 406578, 308, 3996977, 34937078, 2, 502, 28010167, 1530292965, 2, 508164038, 2, 54902992348, 51712929897, 1269, 2, 3217847072904, 8597641914, 9168720349613
Offset: 0

Views

Author

Gus Wiseman, Nov 18 2018

Keywords

Comments

A non-normal semi-magic square multiset partition of weight n is a multiset partition of weight n whose part sizes and vertex degrees are all equal to d, for some d|n.
The weight of a multiset partition is the sum of sizes of its parts. Weight is generally not the same as number of vertices.
Also the number of nonnegative integer square matrices up to row and column permutations with sum of elements equal to n and no zero rows or columns, with row sums and column sums all equal to d, for some d|n.

Examples

			Non-isomorphic representatives of the a(2) = 2 through a(6) = 7 multiset partitions:
  {{11}}   {{111}}     {{1111}}       {{11111}}         {{111111}}
  {{1}{2}} {{1}{2}{3}} {{11}{22}}     {{1}{2}{3}{4}{5}} {{111}{222}}
                       {{12}{12}}                       {{112}{122}}
                       {{1}{2}{3}{4}}                   {{11}{22}{33}}
                                                        {{11}{23}{23}}
                                                        {{12}{13}{23}}
                                                        {{1}{2}{3}{4}{5}{6}}
Inequivalent representatives of the a(6) = 7 matrices:
  [6]
.
  [3 0] [2 1]
  [0 3] [1 2]
.
  [2 0 0] [2 0 0] [1 1 0]
  [0 2 0] [0 1 1] [1 0 1]
  [0 0 2] [0 1 1] [0 1 1]
.
  [1 0 0 0 0 0]
  [0 1 0 0 0 0]
  [0 0 1 0 0 0]
  [0 0 0 1 0 0]
  [0 0 0 0 1 0]
  [0 0 0 0 0 1]
Inequivalent representatives of the a(9) = 7 matrices:
  [9]
.
  [3 0 0] [3 0 0] [2 1 0] [2 1 0] [1 1 1]
  [0 3 0] [0 2 1] [1 1 1] [1 0 2] [1 1 1]
  [0 0 3] [0 1 2] [0 1 2] [0 2 1] [1 1 1]
.
  [1 0 0 0 0 0 0 0 0]
  [0 1 0 0 0 0 0 0 0]
  [0 0 1 0 0 0 0 0 0]
  [0 0 0 1 0 0 0 0 0]
  [0 0 0 0 1 0 0 0 0]
  [0 0 0 0 0 1 0 0 0]
  [0 0 0 0 0 0 1 0 0]
  [0 0 0 0 0 0 0 1 0]
  [0 0 0 0 0 0 0 0 1]
		

Crossrefs

Formula

a(p) = 2 for p prime corresponding to the 1 X 1 square [p] and the permutation matrices of size p X p with partition (1...10...0). - Chai Wah Wu, Jan 16 2019
a(n) = Sum_{d|n} A333733(d,n/d) for n > 0. - Andrew Howroyd, Apr 11 2020

Extensions

a(11)-a(13) from Chai Wah Wu, Jan 16 2019
a(14)-a(15) from Chai Wah Wu, Jan 20 2019
Terms a(16) and beyond from Andrew Howroyd, Apr 11 2020

A321722 Number of non-normal magic squares whose entries are nonnegative integers summing to n.

Original entry on oeis.org

1, 1, 1, 1, 10, 21, 97, 657, 5618, 48918, 494530, 5383553, 65112565, 840566081, 11834555867, 176621056393, 2838064404989, 48060623405313
Offset: 0

Views

Author

Gus Wiseman, Nov 18 2018

Keywords

Comments

A non-normal magic square is a square matrix with row sums, column sums, and both diagonals all equal to d, for some d|n.

Examples

			The a(4) = 10 magic squares:
  [4]
.
  [1 1]
  [1 1]
.
  [1 0 0 0][1 0 0 0][0 1 0 0][0 1 0 0][0 0 1 0][0 0 1 0][0 0 0 1][0 0 0 1]
  [0 0 1 0][0 0 0 1][0 0 1 0][0 0 0 1][1 0 0 0][0 1 0 0][1 0 0 0][0 1 0 0]
  [0 0 0 1][0 1 0 0][1 0 0 0][0 0 1 0][0 1 0 0][0 0 0 1][0 0 1 0][1 0 0 0]
  [0 1 0 0][0 0 1 0][0 0 0 1][1 0 0 0][0 0 0 1][1 0 0 0][0 1 0 0][0 0 1 0]
		

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]}]];
    Table[Length[Select[multsubs[Tuples[Range[n],2],n],And[Union[First/@#]==Range[Max@@First/@#]==Union[Last/@#],SameQ@@Join[{Tr[prs2mat[#]],Tr[Reverse[prs2mat[#]]]},Total/@prs2mat[#],Total/@Transpose[prs2mat[#]]]]&]],{n,5}]

Formula

a(p) = A007016(p) + 1 if p is prime. a(n) >= A007016(n) + 1 for n > 1. - Chai Wah Wu, Jan 15 2019

Extensions

a(7)-a(15) from Chai Wah Wu, Jan 15 2019
a(16)-a(17) from Chai Wah Wu, Jan 16 2019

A057150 Triangle read by rows: T(n,k) = number of k X k binary matrices with n ones, with no zero rows or columns, up to row and column permutation.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 0, 5, 2, 1, 0, 0, 4, 11, 2, 1, 0, 0, 3, 21, 14, 2, 1, 0, 0, 1, 34, 49, 15, 2, 1, 0, 0, 1, 33, 131, 69, 15, 2, 1, 0, 0, 0, 33, 248, 288, 79, 15, 2, 1, 0, 0, 0, 19, 410, 840, 420, 82, 15, 2, 1, 0, 0, 0, 14, 531, 2144, 1744, 497, 83, 15, 2, 1
Offset: 1

Views

Author

Vladeta Jovovic, Aug 14 2000

Keywords

Comments

Also the number of non-isomorphic set multipartitions (multisets of sets) of weight n with k parts and k vertices. - Gus Wiseman, Nov 14 2018

Examples

			[1], [0,1], [0,1,1], [0,1,2,1], [0,0,5,2,1], [0,0,4,11,2,1], ...;
There are 8 square binary matrices with 5 ones, with no zero rows or columns, up to row and column permutation: 5 of size 3 X 3:
[0 0 1] [0 0 1] [0 0 1] [0 0 1] [0 0 1]
[0 0 1] [0 1 0] [0 1 1] [0 1 1] [1 1 0]
[1 1 1] [1 1 1] [1 0 1] [1 1 0] [1 1 0]
2 of size 4 X 4:
[0 0 0 1] [0 0 0 1]
[0 0 0 1] [0 0 1 0]
[0 0 1 0] [0 1 0 0]
[1 1 0 0] [1 0 0 1]
and 1 of size 5 X 5:
[0 0 0 0 1]
[0 0 0 1 0]
[0 0 1 0 0]
[0 1 0 0 0]
[1 0 0 0 0].
From _Gus Wiseman_, Nov 14 2018: (Start)
Triangle begins:
   1
   0   1
   0   1   1
   0   1   2   1
   0   0   5   2   1
   0   0   4  11   2   1
   0   0   3  21  14   2   1
   0   0   1  34  49  15   2   1
   0   0   1  33 131  69  15   2   1
   0   0   0  33 248 288  79  15   2   1
Non-isomorphic representatives of the multiset partitions counted in row 6 {0,0,4,11,2,1} are:
  {{12}{13}{23}}  {{1}{1}{1}{234}}  {{1}{2}{3}{3}{45}}  {{1}{2}{3}{4}{5}{6}}
  {{1}{23}{123}}  {{1}{1}{24}{34}}  {{1}{2}{3}{5}{45}}
  {{13}{23}{23}}  {{1}{1}{4}{234}}
  {{3}{23}{123}}  {{1}{2}{34}{34}}
                  {{1}{3}{24}{34}}
                  {{1}{3}{4}{234}}
                  {{1}{4}{24}{34}}
                  {{1}{4}{4}{234}}
                  {{2}{4}{12}{34}}
                  {{3}{4}{12}{34}}
                  {{4}{4}{12}{34}}
(End)
		

Crossrefs

Programs

  • Mathematica
    permcount[v_List] := Module[{m = 1, s = 0, k = 0, t}, For[i = 1, i <= Length[v], i++, t = v[[i]]; k = If[i > 1 && t == v[[i - 1]], k + 1, 1]; m *= t*k; s += t]; s!/m];
    c[p_List, q_List, k_] := SeriesCoefficient[Product[Product[(1 + O[x]^(k + 1) + x^LCM[p[[i]], q[[j]]])^GCD[p[[i]], q[[j]]], {j, 1, Length[q]}], {i, 1, Length[p]}], {x, 0, k}];
    M[m_, n_, k_] := M[m, n, k] = Module[{s = 0}, Do[Do[s += permcount[p]* permcount[q]*c[p, q, k], {q, IntegerPartitions[n]}], {p, IntegerPartitions[m]}]; s/(m!*n!)];
    T[n_, k_] := M[k, k, n] - 2*M[k, k - 1, n] + M[k - 1, k - 1, n];
    Table[T[n, k], {n, 1, 12}, {k, 1, n}] // Flatten (* Jean-François Alcover, Sep 10 2019, after Andrew Howroyd *)
  • PARI
    \\ See A321609 for M.
    T(n,k) = M(k,k,n) - 2*M(k,k-1,n) + M(k-1,k-1,n); \\ Andrew Howroyd, Nov 14 2018

Extensions

Duplicate seventh row removed by Gus Wiseman, Nov 14 2018
Showing 1-10 of 26 results. Next