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.

A257493 Number A(n,k) of n X n nonnegative integer matrices with all row and column sums equal to k; square array A(n,k), n >= 0, k >= 0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 6, 1, 1, 1, 4, 21, 24, 1, 1, 1, 5, 55, 282, 120, 1, 1, 1, 6, 120, 2008, 6210, 720, 1, 1, 1, 7, 231, 10147, 153040, 202410, 5040, 1, 1, 1, 8, 406, 40176, 2224955, 20933840, 9135630, 40320, 1, 1, 1, 9, 666, 132724, 22069251, 1047649905, 4662857360, 545007960, 362880, 1
Offset: 0

Views

Author

Alois P. Heinz, Apr 26 2015

Keywords

Comments

Also the number of ordered factorizations of m^k into n factors, where m is a product of exactly n distinct primes and each factor is a product of k primes (counted with multiplicity). A(2,2) = 3: (2*3)^2 = 36 = 4*9 = 6*6 = 9*4.

Examples

			Square array A(n,k) begins:
  1,   1,      1,        1,          1,           1,            1, ...
  1,   1,      1,        1,          1,           1,            1, ...
  1,   2,      3,        4,          5,           6,            7, ...
  1,   6,     21,       55,        120,         231,          406, ...
  1,  24,    282,     2008,      10147,       40176,       132724, ...
  1, 120,   6210,   153040,    2224955,    22069251,    164176640, ...
  1, 720, 202410, 20933840, 1047649905, 30767936616, 602351808741, ...
		

Crossrefs

Rows n=0+1, 2-9 give: A000012, A000027(k+1), A002817(k+1), A001496, A003438, A003439, A008552, A160318, A160319.
Main diagonal gives A110058.
Cf. A257463 (unordered factorizations), A333733 (non-isomorphic matrices), A008300 (binary matrices).

Programs

  • Maple
    with(numtheory):
    b:= proc(n, k) option remember; `if`(n=1, 1, add(
          `if`(bigomega(d)=k, b(n/d, k), 0), d=divisors(n)))
        end:
    A:= (n, k)-> b(mul(ithprime(i), i=1..n)^k, k):
    seq(seq(A(n, d-n), n=0..d), d=0..8);
  • Mathematica
    b[n_, k_] := b[n, k] = If[n==1, 1, Sum[If[PrimeOmega[d]==k, b[n/d, k], 0], {d, Divisors[n]}]]; A[n_, k_] := b[Product[Prime[i], {i, 1, n}]^k, k]; Table[A[n, d-n], {d, 0, 10}, {n, 0, d}] // Flatten (* Jean-François Alcover, Feb 20 2016, after Alois P. Heinz *)
  • PARI
    T(n, k)={
      local(M=Map(Mat([n, 1])));
      my(acc(p, v)=my(z); mapput(M, p, if(mapisdefined(M, p, &z), z+v, v)));
      my(recurse(h, p, q, v, e) = if(!p, if(!e, acc(q, v)), my(i=poldegree(p), t=pollead(p)); self()(k, p-t*x^i, q+t*x^i, v, e); for(m=1, h-i, for(j=1, min(t, e\m), self()(if(j==t, k, i+m-1), p-j*x^i, q+j*x^(i+m), binomial(t, j)*v, e-j*m)))));
      for(r=1, n, my(src=Mat(M)); M=Map(); for(i=1, matsize(src)[1], recurse(k, src[i, 1], 0, src[i, 2], k))); vecsum(Mat(M)[, 2])
    } \\ Andrew Howroyd, Apr 04 2020
  • Sage
    bigomega = sloane.A001222
    @cached_function
    def b(n, k):
        if n == 1:
            return 1
        return sum(b(n//d, k) if bigomega(d) == k else 0 for d in n.divisors())
    def A(n, k):
        return b(prod(nth_prime(i) for i in (1..n))^k, k)
    [A(n, d-n) for d in (0..10) for n in (0..d)] # Freddy Barrera, Dec 27 2018, translated from Maple
    
  • Sage
    from sage.combinat.integer_matrices import IntegerMatrices
    [IntegerMatrices([d-n]*n, [d-n]*n).cardinality() for d in (0..10) for n in (0..d)] # Freddy Barrera, Dec 27 2018
    

A001496 Number of 4 X 4 matrices with nonnegative integer entries and row and column sums equal to n.

Original entry on oeis.org

1, 24, 282, 2008, 10147, 40176, 132724, 381424, 981541, 2309384, 5045326, 10356424, 20158151, 37478624, 66952936, 115479776, 193077449, 313981688, 498033282, 772409528, 1173759851, 1750812624, 2567527260, 3706873040
Offset: 0

Views

Author

Keywords

Comments

Number of 4 X 4 stochastic matrices of integers.

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 124, #25, Q(4,r).
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • R. P. Stanley, Enumerative Combinatorics, Wadsworth, Vol. 1, 1986, pages 233-234.
  • M. L. Stein and P. R. Stein, Enumeration of Stochastic Matrices with Integer Elements. Report LA-4434, Los Alamos Scientific Laboratory of the University of California, Los Alamos, NM, Jun 1970.

Crossrefs

See A002721 for a 3-dimensional analog.
Row n=4 of A257493.

Programs

  • Mathematica
    CoefficientList[Series[(1 + 14*x + 87*x^2 + 148*x^3 + 87*x^4 + 14*x^5 + x^6)/(1 - x)^10, {x, 0, 30}], x] (* Wesley Ivan Hurt, Jan 24 2017 *)
    LinearRecurrence[{10,-45,120,-210,252,-210,120,-45,10,-1},{1,24,282,2008,10147,40176,132724,381424,981541,2309384},30] (* Harvey P. Dale, Jul 12 2017 *)
  • PARI
    x='x+O('x^99); Vec((1+14*x+87*x^2+148*x^3+87*x^4+14*x^5+x^6)/(1-x)^10) \\ Altug Alkan, Apr 17 2016

Formula

G.f.: (1+14*x+87*x^2+148*x^3+87*x^4+14*x^5+x^6)/(1-x)^10.
a(n) = binomial(n + 3, 3) + 20*binomial(n + 4, 5) + 152*binomial(n + 5, 7) + 352*binomial(n + 6, 9). [Equivalent to a formula given by Bell].

Extensions

More terms from Vladeta Jovovic, Feb 06 2000

A058391 Number of 5 X 5 matrices with nonnegative integer entries and all row sums equal to n, up to row and column permutation.

Original entry on oeis.org

1, 7, 198, 5929, 145168, 2459994, 30170387, 282159907, 2114430613, 13190940964, 70598379694, 331820068035, 1395291176641, 5327752138987, 18698405435444, 60922707883197, 185814239933254, 534246250634068, 1456622823771075
Offset: 0

Views

Author

Vladeta Jovovic, Nov 24 2000

Keywords

Crossrefs

Programs

Showing 1-3 of 3 results.