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-5 of 5 results.

A001142 a(n) = Product_{k=1..n} k^(2k - 1 - n).

Original entry on oeis.org

1, 1, 2, 9, 96, 2500, 162000, 26471025, 11014635520, 11759522374656, 32406091200000000, 231627686043080250000, 4311500661703860387840000, 209706417310526095716965894400, 26729809777664965932590782608648192
Offset: 0

Views

Author

Keywords

Comments

Absolute value of determinant of triangular matrix containing binomial coefficients.
These are also the products of consecutive horizontal rows of the Pascal triangle. - Jeremy Hehn (ROBO_HEN5000(AT)rose.net), Mar 29 2007
Limit_{n->oo} a(n)*a(n+2)/a(n+1)^2 = e, as follows from lim_{n->oo} (1 + 1/n)^n = e. - Harlan J. Brothers, Nov 26 2009
A000225 gives the positions of odd terms. - Antti Karttunen, Nov 02 2014
Product of all unreduced fractions h/k with 1 <= k <= h <= n. - Jonathan Sondow, Aug 06 2015
a(n) is a product of the binomial coefficients from the n-th row of the Pascal triangle, for n= 0, 1, 2, ... For n > 0, a(n) means the number of all maximum chains in the poset formed by the n-dimensional Boolean cube {0,1}^n and the relation "precedes by weight". This relation is defined over {0,1}^n as follows: for arbitrary vectors u, v of {0,1}^n we say that "u precedes by weight v" if wt(u) < wt(v) or if u = v, where wt(u) denotes the (Hamming) weight of u. For more details, see the sequence A051459. - Valentin Bakoev, May 17 2019

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 828.
  • 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).

Crossrefs

Cf. also A004788, A056606 (squarefree kernel), A256113.

Programs

  • GAP
    List([0..15], n-> Product([0..n], k-> Binomial(n,k) )); # G. C. Greubel, May 23 2019
    
  • Haskell
    a001142 = product . a007318_row -- Reinhard Zumkeller, Mar 16 2015
    
  • Magma
    [(&*[Binomial(n,k): k in [0..n]]): n in [0..15]]; // G. C. Greubel, May 23 2019
    
  • Maple
    a:=n->mul(binomial(n,k), k=0..n): seq(a(n), n=0..14); # Zerinvary Lajos, Jan 22 2008
  • Mathematica
    Table[Product[k^(2*k - 1 - n), {k, n}], {n, 0, 20}] (* Harlan J. Brothers, Nov 26 2009 *)
    Table[Hyperfactorial[n]/BarnesG[n+2], {n, 0, 20}] (* Peter Luschny, Nov 29 2015 *)
    Table[Product[(n - k + 1)^(n - 2 k + 1), {k, 1, n}], {n, 0, 20}] (* Harlan J. Brothers, Aug 26 2023 *)
  • Maxima
    a(n):= prod(binomial(n,k),k,0,n); n : 15; for i from 0 thru n do print (a(i)); /* Valentin Bakoev, May 17 2019 */
    
  • PARI
    for(n=0,16,print(prod(m=1,n,binomial(n,m))))
    
  • PARI
    A001142(n) = prod(k=1, n, k^((k+k)-1-n)); \\ Antti Karttunen, Nov 02 2014
    
  • Python
    from math import factorial, prod
    from fractions import Fraction
    def A001142(n): return prod(Fraction((k+1)**k,factorial(k)) for k in range(1,n)) # Chai Wah Wu, Jul 15 2022
  • Sage
    a = lambda n: prod(k^k/factorial(k) for k in (1..n))
    [a(n) for n in range(20)] # Peter Luschny, Nov 29 2015
    
  • Scheme
    (define (A001142 n) (mul (lambda (k) (expt k (+ k k -1 (- n)))) 1 n))
    (define (mul intfun lowlim uplim) (let multloop ((i lowlim) (res 1)) (cond ((> i uplim) res) (else (multloop (+ 1 i) (* res (intfun i)))))))
    ;; Antti Karttunen, Oct 28 2014
    

Formula

a(n) = C(n, 0)*C(n, 1)* ... *C(n, n).
From Harlan J. Brothers, Nov 26 2009: (Start)
a(n) = Product_{j=1..n-2} Product_{k=1..j} (1+1/k)^k, n >= 3.
a(1) = a(2) = 1, a(n) = a(n-1) * Product_{k=1..n-2} (1+1/k)^k. (End)
a(n) = hyperfactorial(n)/superfactorial(n) = A002109(n)/A000178(n). - Peter Luschny, Jun 24 2012
a(n) ~ A^2 * exp(n^2/2 + n - 1/12) / (n^(n/2 + 1/3) * (2*Pi)^((n+1)/2)), where A = A074962 = 1.2824271291... is the Glaisher-Kinkelin constant. - Vaclav Kotesovec, Jul 10 2015
a(n) = Product_{i=1..n} Product_{j=1..i} (i/j). - Pedro Caceres, Apr 06 2019
a(n) = Product_{k=1..n} (n - k + 1)^(n - 2*k + 1). - Harlan J. Brothers, Aug 26 2023

Extensions

More terms from James Sellers, May 01 2000
Better description from Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 30 2001

A294648 Irregular triangle read by rows, representing a family of sequences L(n), for n=1, 2, 3, ... The sequence L(n) (i.e., the n-th row) is the ordinance of vectors of the n-dimensional Boolean cube (hypercube) {0,1}^n in accordance with their (Hamming) weights, where the lexicographic order is chosen as a second criterion for an ordinance the vectors of equal weights.

Original entry on oeis.org

0, 1, 0, 1, 2, 3, 0, 1, 2, 4, 3, 5, 6, 7, 0, 1, 2, 4, 8, 3, 5, 6, 9, 10, 12, 7, 11, 13, 14, 15, 0, 1, 2, 4, 8, 16, 3, 5, 6, 9, 10, 12, 17, 18, 20, 24, 7, 11, 13, 14, 19, 21, 22, 25, 26, 28, 15, 23, 27, 29, 30, 31, 0, 1, 2, 4, 8, 16, 32, 3, 5, 6, 9, 10, 12, 17, 18, 20, 24, 33, 34, 36, 40, 48, 7, 11, 13, 14, 19, 21
Offset: 1

Views

Author

Valentin Bakoev, Nov 06 2017

Keywords

Comments

The sequences represent the ordinance of vectors of the n-dimensional Boolean cube (hypercube) {0,1}^n in accordance with their (Hamming) weights. The lexicographic order is chosen as a second criterion for the ordinance of the vectors of equal weights. We refer to this order as a Weight-Lexicographic Order (WLO). The WLO is represented by the (serial) numbers of the vectors, instead of the vectors itself. It is well known that if the vectors of {0,1}^n are in lexicographic (standard) order, their numbers form the sequence of natural numbers 0, 1, 2, ..., 2^n-1. So, the WLO means a permutation of the numbers 0, 1, 2, ..., 2^n-1, such that the corresponding vectors are in WLO. This sequence (permutation) is denoted by L(n). It consists of (n+1) subsequences, corresponding to the layers of the Boolean cube.

Examples

			The lexicographic order of {0,1}^3 is: (0,0,0), (0,0,1), (0,1,0), (0,1,1), (1,0,0), (1,0,1), (1,1,0), (1,1,1), and the corresponding sequence of (serial) numbers is: 0, 1, 2, ..., 7. The WLO of these vectors is given by the sequence L(3)= 0, 1, 2, 4, 3, 5, 6, 7.
The triangle starts:
n=1: 0, 1;
n=2: 0, 1, 2, 3;
n=3: 0, 1, 2, 4, 3, 5, 6, 7;
n=4: 0, 1, 2, 4, 8, 3, 5, 6, 9, 10, 12, 7, 11, 13, 14, 15;
n=5: 0, 1, 2, 4, 8, 16, 3, 5, 6, 9, 10, 12, 17, 18, 20, 24, 7, 11, 13, 14, 19, 21, 22, 25, 26, 28, 15, 23, 27, 29, 30, 31;
n=6: 0, 1, 2, 4, 8, 16, 32, 3, 5, 6, 9, 10, 12, 17, 18, 20, 24, 33, 34, 36, 40, 48, 7, 11, 13, 14, 19, 21, 22, 25, 26, 28, 35, 37, 38, 41, 42, 44, 49, 50, 52, 56, 15, 23, 27, 29, 30, 39, 43, 45, 46, 51, 53, 54, 57, 58, 60, 31, 47, 55, 59, 61, 62, 63;
		

Crossrefs

A051459 gives the orders' number of the vectors of {0,1}^n in accordance with their weights.
Cf. A007318, A047869 (8th row), A091444 (as bits), A187769, A263327 (10th row).
Cf. A382467.

Programs

  • Maple
    with(ListTools): conc := (a,b,c) -> Flatten([op(a),[seq(op(j)+c, j in b)]], 1):
    rec := proc(n,k) option remember; `if`(k=0, [0], `if`(k=n, [2^n-1], conc(rec(n-1,k), rec(n-1,k-1), 2^(n-1)))) end:
    L := n -> `if`(n=1, [0,1], Flatten([seq(rec(n,k),k=0..n)], 1)):
    Flatten([seq(L(n), n = 1..6)], 1); # Peter Luschny, Nov 06 2017
  • Mathematica
    conc[a_List, b_List, c_] := Join[a, b + c];
    rec[n_, k_] := rec[n, k] = If[k == 0, {0}, If[k == n, {2^n - 1}, conc[rec[n - 1, k], rec[n - 1, k - 1], 2^(n - 1)]]];
    L[n_] := If[n == 1, {0, 1}, Flatten[Table[rec[n, k], {k, 0, n}]]];
    Array[L, 6] // Flatten (* Jean-François Alcover, Jul 26 2018, after Peter Luschny *)
    Table[SortBy[Range[0, 2^n - 1], DigitSum[#, 2] &], {n, 6}] (* Paolo Xausa, Jul 28 2025 *)
  • PARI
    cmph(x, y) = my(d=hammingweight(x)-hammingweight(y)); if (d, d, x-y);
    row(n) = my(v=[0..2^n-1]); vecsort(v, cmph); \\ Michel Marcus, Sep 16 2023
  • Python
    from itertools import product
    def sortby(x): return (len(x), x.count('1'), x)
    def agen(maxbindigs):
        for i in range(1, maxbindigs+1):
            for t in sorted([p for p in product("01", repeat=i)], key=sortby):
                yield int("".join(t), 2)
    print([an for an in agen(6)]) # Michael S. Branicky, Aug 13 2021
    

Formula

For n=1, 2, 3, ..., L(n) is defined by the recurrence:
if n=1, L(1)= 0, 1;
else L(n)= l(n, 0), l(n, 1), ..., l(n, k), ..., l(n, n), where the subsequences are defined as follows:
l(n, k)= 0, if k=0, else
l(n, k)= 2^n - 1, if k=n, else
l(n, k)= l(n-1, k), l(n-1, k-1) + 2^{n-1}, for 0 < k < n.
Comments:
1) l(n, k)= l(n-1, k), l(n-1, k-1) + 2^{n-1} means that l(n, k) is a concatenation of two subsequences: l(n-1, k) and l(n-1, k-1) + 2^{n-1}. The second one is obtained after addition of the number 2^{n-1} to each member of l(n-1,k-1).
2) The computing of the members of L(n) resembles the computing (and filling in) the binomial coefficients in Pascal's triangle. The binomial coefficients determine the lengths of the subsequences l(n, k), 0 <= k <= n, in L(n). Thus the beginning of each subsequence can be computed easily.
3) The inductive formula, corresponding to the recurrence, is much more useful for implementations.

A022914 Multinomial coefficients(TOP, BOTTOM), where TOP = 2^n, BOTTOM = ( C(n,0) C(n,1) C(n,2) ... C(n,n) ).

Original entry on oeis.org

1, 2, 12, 1120, 50450400, 1387660381886338560, 58833957894412548628347941194431580569600, 54468560860672704568758301042326371229883670125439070950586847311164532855256159027200000
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A051459.

Programs

  • Maple
    with(combinat):
    a:= n-> multinomial(2^n, seq(binomial(n, i), i=0..n)):
    seq(a(n), n=0..8);  # Alois P. Heinz, Sep 24 2013
  • Mathematica
    Table[(2^n)!/Product[Binomial[n, k]!, {k, 0, n}], {n, 0, 8}] (* Vaclav Kotesovec, Nov 24 2023 *)

Extensions

More terms from James Sellers, May 02 2000

A046873 Number of total orders extending inclusion on P({1,...,n}).

Original entry on oeis.org

1, 1, 2, 48, 1680384, 14807804035657359360, 141377911697227887117195970316200795630205476957716480
Offset: 0

Views

Author

Keywords

Comments

Trivial upper bound: a(n) <= (2^n)!.
Number of linear extensions of the Boolean lattice 2^n. - Mitch Harris, Dec 27 2005
The number of vertices in the representation of all linear extensions in a distributive lattice are the Dedekind numbers (A000372) and the number of edges constitutes A118077. - Oliver Wienand, Apr 11 2006
A lower bound is A051459(n) = Product_{k=0..n} binomial(n,k)! <= a(n). - Geoffrey Critzer, May 20 2018

Examples

			a(2)=2 because either {}<{0}<{1}<{0,1} or {}<{1}<{0}<{0,1}.
		

Crossrefs

Extensions

a(5) from Oliver Wienand, Apr 11 2006, using Python and an inference method for computing the set of linear extensions of arbitrary posets. Using the same method on a compute server generated a(6) on Dec 05 2010.
a(7) from J. Daniel Christensen, Feb 13 2017, based on Brouwer-Christensen work cited above, using C.

A359336 Irregular triangle read by rows: the n-th row lists the values 0..2^n-1 representing all subsets of a set of n elements. When its elements are linearly ordered, the subsets are sorted first by their size and then lexicographically.

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 3, 0, 4, 2, 1, 6, 5, 3, 7, 0, 8, 4, 2, 1, 12, 10, 9, 6, 5, 3, 14, 13, 11, 7, 15, 0, 16, 8, 4, 2, 1, 24, 20, 18, 17, 12, 10, 9, 6, 5, 3, 28, 26, 25, 22, 21, 19, 14, 13, 11, 7, 30, 29, 27, 23, 15, 31, 0, 32, 16, 8, 4, 2, 1, 48, 40, 36, 34, 33, 24, 20, 18, 17, 12, 10, 9, 6, 5, 3, 56, 52, 50, 49
Offset: 0

Views

Author

Valentin Bakoev, Dec 27 2022

Keywords

Comments

The n-th row of the table is denoted by row(n) and contains a permutation of the integers from the interval [0, 2^n-1] which defines an ordering of all binary vectors of length n. Let the elements of the set B_n = {b_n, b_(n-1), ..., b_2, b_1} be linearly ordered: b_n < b_(n-1) < ... < b_2 < b_1. When we consider the binary vectors defined by row(n) as characteristic vectors, they define all subsets of B_n, sorted first by their cardinalities and then lexicographically. The sequence in row(n) is partitioned into n+1 subsequences of integers whose binary vectors have the same (Hamming) weight.
Equivalently, the sequence in row(n) defines all (n,k) combinations over a linearly ordered set in lexicographic order, for k = 0, 1, ..., n.
Like A294648 and A351939, A359336 represents one of the numerous weight orderings of the vectors of the n-dimensional Boolean cube (or the subsets of a set of n-elements sorted by their size) - see A051459.
Following the formula for row(n), we get:
T(n,0) = 0;
T(n, 2^n-1) = 2^n-1;
T(n,n) = 1, for n >= 1.
T(n,k) = 2^(n-k) for 1 <= k <= n.
Thus the regular triangle T(n,k), for n = 1, 2, 3, ... and for 1 <= k <= n consists of powers of 2 (A000079): in ascending order by columns and in descending order by rows.

Examples

			In the following table, the members of row(3) are given in column dec., the corresponding characteristic vectors are in column bin., and the corresponding subsets of B_3 are listed under B_3.
dec., bin., B_3 = {a, b, c}
---------------------------
 0    000        {}
 4    100        {a}
 2    010        {b}
 1    001        {c}
 6    110        {a, b}
 5    101        {a, c}
 3    011        {b, c}
 7    111        {a, b, c}
As seen, the corresponding subsets of equal size are ordered lexicographically.
Triangle T(n,k) begins:
    k = 0   1   2   3   4   5   6   7 ...
  n=0:  0;
  n=1:  0,  1;
  n=2:  0,  2,  1,  3;
  n=3:  0,  4,  2,  1,  6,  5,  3,  7;
  n=4:  0,  8,  4,  2,  1, 12, 10,  9,  6,  5,  3, 14, 13, 11,  7, 15,
  n=5:  0, 16,  8,  4,  2,  1, 24, 20, 18, 17, 12, 10,  9,  6,  5,  3, 28, 26, 25, 22, 21, 19, 14, 13, 11, 7, 30, 29, 27, 23, 15, 31;
  ...
		

Crossrefs

Cf. A000004 (column k=0), A000225 (right border), A000012 (main diagonal), A006516 (row sums).
Cf. A294648 (weight-lexicographic order of the binary vectors), A351939 (the values 0..2^n-1 sorted first by Hamming weight and then by position in reflected Gray code).
Cf. A356028.

Formula

For n = 1, 2, 3, ..., row(n) is a concatenation of the subsequences r(n, 0), r(n, 1), ..., r(n, n) defined by the recurrence:
r(n, 0) = (0),
r(n, n) = (2^n - 1),
r(n, k) = (r(n-1, k-1) + 2^(n-1)) concatenate r(n-1, k), for 0 < k < n.
In the above, r(n-1, k-1) + 2^(n-1) means the 2^(n-1) is added to each member of the subsequence r(n-1, k-1).
Showing 1-5 of 5 results.