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

A325201 Square array whose entry A(n,k) is the number of labeled rooted trees on a set of size n where each node has at most k neighbors that are further away from the root than the node itself, for n >= 0, k >= 0, read by descending antidiagonals.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 2, 6, 0, 0, 1, 2, 9, 24, 0, 0, 1, 2, 9, 60, 120, 0, 0, 1, 2, 9, 64, 540, 720, 0, 0, 1, 2, 9, 64, 620, 6120, 5040, 0, 0, 1, 2, 9, 64, 625, 7620, 83790, 40320, 0, 0, 1, 2, 9, 64, 625, 7770, 113610, 1345680, 362880, 0, 0, 1, 2, 9, 64, 625, 7776, 117390, 1992480, 24811920, 3628800, 0
Offset: 1

Views

Author

Benjamin Otto, Apr 08 2019

Keywords

Comments

A preimage constraint on a function is a set of nonnegative integers such that the size of the inverse image of any element is one of the values in that set. View a labeled rooted tree as an endofunction on the set {1,2,...,n} by sending every non-root node to its neighbor that is closer to the root and sending the root to itself.
Thus, A(n,k) is the number of endofunctions on a set of size n with exactly one cyclic point and such that each preimage has at most k entries.

Examples

			Array begins:
           0           0           0           0           0 ...
           0           1           1           1           1 ...
           0           2           2           2           2 ...
           0           6           9           9           9 ...
           0          24          60          64          64 ...
           0         120         540         620         625 ...
           0         720        6120        7620        7770 ...
           0        5040       83790      113610      117390 ...
           0       40320     1345680     1992480     2088520 ...
           0      362880    24811920    40194000    42771960 ...
           0     3628800   516650400   916927200   991090800 ...
           0    39916800 11992503600 23341071600 25635767850 ...
         ...
		

Crossrefs

Column 0: A000004.
Column 1 is A000142, except at n=0 term.
A(n,n) gives A152917.
Similar array for arbitrary endofunctions (without limitation on the number of cyclic points) with the same preimage condition {i>=0 | i<=k}: A306800.

Programs

  • Mathematica
    e[k_][x_] := Sum[x^j/j!, {j, 0, k}];
    A[0, ] = A[, 0] = 0; A[n_, k_] := (n-1)! Coefficient[e[k][x]^n, x, n-1];
    Table[A[n-k, k], {n, 0, 11}, {k, n, 0, -1}] (* Jean-François Alcover, Jul 06 2019 *)
  • Python
    # print first num_entries entries in column k
    import math, sympy; x=sympy.symbols('x')
    k=5; num_entries = 64
    P=range(k+1); eP=sum([x**d/math.factorial(d) for d in P]); r = [0,1]; curr_pow = eP
    for term in range(1, num_entries-1):
        curr_pow=(curr_pow*eP).expand()
        r.append(curr_pow.coeff(x**term)*math.factorial(term))
    print(r)

Formula

A(n,k) = (n-1)! * [x^(n-1)] e_k(x)^n, where e_k(x) is the truncated exponential 1 + x + x^2/2! + ... + x^k/k!. When k>1, the link above yields explicit constants c_k, r_k so that the columns are asymptotically c_k * n^(-3/2) * r_k^-n. Stirling's approximation gives column k=1, and column k=0 is 0.

A324804 a(n) is the number of endofunctions on a set of size n with preimage constraint {0, 1, 2, 3, 4}.

Original entry on oeis.org

1, 1, 4, 27, 256, 3120, 46470, 817950, 16612120, 382367160, 9836517600, 279684716850, 8709747354000, 294818964039600, 10777792243818600, 423193629950091000, 17762853608696196000, 793668469023770340000, 37611450798744238416000, 1884235285123539720372000
Offset: 0

Views

Author

Benjamin Otto, Mar 15 2019

Keywords

Comments

A preimage constraint is a set of nonnegative integers such that the size of the inverse image of any element is one of the values in that set. Thus, the n-th term of the sequence is the number of endofunctions on a set of size n such that each preimage has at most 4 elements. Equivalently, it is the number of n-letter words from an n-letter alphabet such that no letter appears more than 4 times.

Crossrefs

Column k=4 of A306800; see that entry for sequences related to other preimage constraints constructions.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0 and i=0, 1, `if`(i<1, 0,
          add(b(n-j, i-1)*binomial(n, j), j=0..min(4, n))))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..21);  # Alois P. Heinz, Apr 01 2019
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0 && i == 0, 1, If[i<1, 0, Sum[b[n-j, i-1]* Binomial[n, j], {j, 0, Min[4, n]}]]];
    a[n_] := b[n, n];
    Table[a[n], {n, 0, 21}] (* Jean-François Alcover, May 31 2019, after Alois P. Heinz *)
  • Python
    # print first num_entries entries in the sequence import math, sympy; x=sympy.symbols('x') k=4; num_entries = 64 P=range(k+1); eP=sum([x**d/math.factorial(d) for d in P]); r = [1]; curr_pow = 1 for term in range(1,num_entries): ...curr_pow=(curr_pow*eP).expand() ...r.append(curr_pow.coeff(x**term)*math.factorial(term)) print(r)

Formula

a(n) = n! * [x^n] e_4(x)^n, where e_k(x) is the truncated exponential 1 + x + x^2/2! + ... + x^k/k!.
The link above yields explicit constants c_k, r_k so that the columns are asymptotically c_4 * n^(-1/2) * r_4^-n.

A324808 a(n) is the number of endofunctions on a set of size n with preimage constraint {0, 1, 2, 3, 4, 5, 6, 7, 8}.

Original entry on oeis.org

1, 1, 4, 27, 256, 3125, 46656, 823543, 16777216, 387420480, 9999999090, 285311608890, 8916096836988, 302874907278372, 11111996007290178, 437893300069054830, 18446711285575475760, 827238394513348062960, 39346298554172667026112, 1978413024254468818876002
Offset: 0

Views

Author

Benjamin Otto, Mar 25 2019

Keywords

Comments

A preimage constraint is a set of nonnegative integers such that the size of the inverse image of any element is one of the values in that set.
Thus, a(n) is the number of endofunctions on a set of size n such that each preimage has at most 8 elements. Equivalently, it is the number of n-letter words from an n-letter alphabet such that no letter appears more than 8 times.

Crossrefs

Column k=8 of A306800; see that entry for sequences related to other preimage constraints constructions.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0 and i=0, 1, `if`(i<1, 0,
          add(b(n-j, i-1)*binomial(n, j), j=0..min(8, n))))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..20);  # Alois P. Heinz, Apr 01 2019
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0 && i == 0, 1, If[i<1, 0, Sum[b[n-j, i-1]*  Binomial[n, j], {j, 0, Min[8, n]}]]];
    a[n_] := b[n, n];
    a /@ Range[0, 19] (* Jean-François Alcover, Feb 29 2020, after Alois P. Heinz *)
  • Python
    # print first num_entries entries in the sequence
    import math, sympy; x=sympy.symbols('x')
    k=8; num_entries = 64
    P=range(k+1); eP=sum([x**d/math.factorial(d) for d in P]); r = [1]; curr_pow = 1
    for term in range(1,num_entries):
       curr_pow=(curr_pow*eP).expand()
       r.append(curr_pow.coeff(x**term)*math.factorial(term))
    print(r)

Formula

a(n) = n! * [x^n] e_8(x)^n, where e_k(x) is the truncated exponential 1 + x+ x^2/2! + ... + x^k/k!. The link above yields explicit constants c_k, r_k so that the columns are asymptotically c_8 * n^(-1/2) * r_8^-n.

A324805 a(n) is the number of endofunctions on a set of size n with preimage constraint {0, 1, 2, 3, 4, 5}.

Original entry on oeis.org

1, 1, 4, 27, 256, 3125, 46650, 823242, 16765784, 387012024, 9985309740, 284765293890, 8894836233360, 302004807340236, 11074484342033112, 436189649979463380, 18365270213907096480, 823145873249916696480, 39130443293729571463680, 1966482487351260975960864
Offset: 0

Views

Author

Benjamin Otto, Mar 25 2019

Keywords

Comments

A preimage constraint is a set of nonnegative integers such that the size of the inverse image of any element is one of the values in that set.
Thus, the n-th term of the sequence is the number of endofunctions on a set of size n such that each preimage has at most 5 elements. Equivalently, it is the number of n-letter words from an n-letter alphabet such that no letter appears more than 5 times.

Crossrefs

Column k=5 of A306800; see that entry for sequences related to other preimage constraints constructions.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0 and i=0, 1, `if`(i<1, 0,
          add(b(n-j, i-1)*binomial(n, j), j=0..min(5, n))))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..20);  # Alois P. Heinz, Apr 01 2019
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0 && i == 0, 1, If[i<1, 0, Sum[b[n-j, i-1]* Binomial[n, j], {j, 0, Min[5, n]}]]];
    a[n_] := b[n, n];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, May 31 2019, after Alois P. Heinz *)
  • Python
    # print first num_entries entries in the sequence
    import math, sympy; x=sympy.symbols('x')
    k=5; num_entries = 64
    P=range(k+1); eP=sum([x**d/math.factorial(d) for d in P]); r = [1]; curr_pow = 1
    for term in range(1,num_entries):
        curr_pow=(curr_pow*eP).expand()
        r.append(curr_pow.coeff(x**term)*math.factorial(term))

Formula

a(n) = n! * [x^n] e_5(x)^n, where e_k(x) is the truncated exponential 1 + x+ x^2/2! + ... + x^k/k!. The link above yields explicit constants c_k, r_k so that the columns are asymptotically c_5 * n^(-1/2) * r_5^-n.

A324806 a(n) is the number of endofunctions on a set of size n with preimage constraint {0, 1, 2, 3, 4, 5, 6}.

Original entry on oeis.org

1, 1, 4, 27, 256, 3125, 46656, 823536, 16776760, 387399096, 9999087840, 285273493890, 8914479240744, 302804132739108, 11108778138153696, 437740674563572380, 18439146872674688160, 826846479804875930400, 39325078741869629444736, 1977213223548343109320992
Offset: 0

Views

Author

Benjamin Otto, Mar 25 2019

Keywords

Comments

A preimage constraint is a set of nonnegative integers such that the size of the inverse image of any element is one of the values in that set.
Thus, the n-th term of the sequence is the number of endofunctions on a set of size n such that each preimage has at most 6 elements. Equivalently, it is the number of n-letter words from an n-letter alphabet such that no letter appears more than 6 times.

Crossrefs

Column k=6 of A306800; see that entry for sequences related to other preimage constraints constructions.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0 and i=0, 1, `if`(i<1, 0,
          add(b(n-j, i-1)*binomial(n, j), j=0..min(6, n))))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..20);  # Alois P. Heinz, Apr 01 2019
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0 && i == 0, 1, If[i<1, 0, Sum[b[n-j, i-1]* Binomial[n, j], {j, 0, Min[6, n]}]]];
    a[n_] := b[n, n];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, May 31 2019, after Alois P. Heinz *)
  • Python
    # print first num_entries entries in the sequence
    import math, sympy; x=sympy.symbols('x')
    k=6; num_entries = 64
    P=range(k+1); eP=sum([x**d/math.factorial(d) for d in P]); r = [1]; curr_pow = 1
    for term in range(1,num_entries):
        curr_pow=(curr_pow*eP).expand()
        r.append(curr_pow.coeff(x**term)*math.factorial(term))
    print(r)

Formula

a(n) = n! * [x^n] e_6(x)^n, where e_k(x) is the truncated exponential 1 + x+ x^2/2! + ... + x^k/k!. The link above yields explicit constants c_k, r_k so that the columns are asymptotically c_6 * n^(-1/2) * r_6^-n.

A324807 a(n) is the number of endofunctions on a set of size n with preimage constraint {0, 1, 2, 3, 4, 5, 6, 7}.

Original entry on oeis.org

1, 1, 4, 27, 256, 3125, 46656, 823543, 16777208, 387419832, 9999962640, 285309793890, 8916009869448, 302870744070180, 11111793078586200, 437883125030581230, 18446183535139520160, 827209994815650320160, 39344710668752223656064, 1978320731100920186439888
Offset: 0

Views

Author

Benjamin Otto, Mar 25 2019

Keywords

Comments

A preimage constraint is a set of nonnegative integers such that the size of the inverse image of any element is one of the values in that set.
Thus, the n-th term of the sequence is the number of endofunctions on a set of size n such that each preimage has at most 7 elements. Equivalently, it is the number of n-letter words from an n-letter alphabet such that no letter appears more than 7 times.

Crossrefs

Column k=7 of A306800; see that entry for sequences related to other preimage constraints constructions.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0 and i=0, 1, `if`(i<1, 0,
          add(b(n-j, i-1)*binomial(n, j), j=0..min(7, n))))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..20);  # Alois P. Heinz, Apr 05 2019
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0 && i == 0, 1, If[i<1, 0, Sum[b[n-j, i-1]* Binomial[n, j], {j, 0, Min[7, n]}]]];
    a[n_] := b[n, n];
    a /@ Range[0, 20] (* Jean-François Alcover, Feb 29 2020, after Alois P. Heinz *)
  • Python
    # print first num_entries entries in the sequence
    import math, sympy; x=sympy.symbols('x')
    k=7; num_entries = 64
    P=range(k+1); eP=sum([x**d/math.factorial(d) for d in P]); r = [1]; curr_pow = 1
    for term in range(1,num_entries):
        curr_pow=(curr_pow*eP).expand()
        r.append(curr_pow.coeff(x**term)*math.factorial(term))
    print(r)

Formula

a(n) = n! * [x^n] e_7(x)^n, where e_k(x) is the truncated exponential 1 + x+ x^2/2! + ... + x^k/k!. The link above yields explicit constants c_k, r_k so that the columns are asymptotically c_7 * n^(-1/2) * r_7^-n.

A324809 a(n) is the number of endofunctions on a set of size n with preimage constraint {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}.

Original entry on oeis.org

1, 1, 4, 27, 256, 3125, 46656, 823543, 16777216, 387420489, 9999999990, 285311669390, 8916100350828, 302875100019492, 11112006413890382, 437893865348970030, 18446742559675475760, 827240169494482480880, 39346402337538654701772, 1978419291074273862219834
Offset: 0

Views

Author

Benjamin Otto, Mar 25 2019

Keywords

Comments

A preimage constraint is a set of nonnegative integers such that the size of the inverse image of any element is one of the values in that set.
Thus, the n-th term of the sequence is the number of endofunctions on a set of size n such that each preimage has at most 9 elements. Equivalently, it is the number of n-letter words from an n-letter alphabet such that no letter appears more than 9 times.

Crossrefs

Column k=9 of A306800; see that entry for sequences related to other preimage constraints constructions.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0 and i=0, 1, `if`(i<1, 0,
          add(b(n-j, i-1)*binomial(n, j), j=0..min(9, n))))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..20);  # Alois P. Heinz, Apr 01 2019
  • Mathematica
     b[n_, i_] := b[n, i] = If[n == 0 && i == 0, 1, If[i < 1, 0, Sum[b[n - j, i - 1]*Binomial[n, j], {j, 0, Min[9, n]}]]];
    a[n_] := b[n, n];
    a /@ Range[0, 20] (* Jean-François Alcover, Mar 01 2020, after Alois P. Heinz *)
  • Python
    # print first num_entries entries in the sequence
    import math, sympy; x=sympy.symbols('x')
    k=9; num_entries = 64
    P=range(k+1); eP=sum([x**d/math.factorial(d) for d in P]); r = [1]; curr_pow = 1
    for term in range(1, num_entries):
       curr_pow=(curr_pow*eP).expand()
       r.append(curr_pow.coeff(x**term)*math.factorial(term))
    print(r)

Formula

a(n) = n! * [x^n] e_9(x)^n, where e_k(x) is the truncated exponential 1 + x+ x^2/2! + ... + x^k/k!. The link above yields explicit constants c_k, r_k so that the columns are asymptotically c_9 * n^(-1/2) * r_9^-n.
Showing 1-7 of 7 results.