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.

A306800 Square array whose entry A(n,k) is the number of endofunctions on a set of size n with preimage constraint {0,1,...,k}, for n >= 0, k >= 0, read by descending antidiagonals.

This page as a plain text file.
%I A306800 #45 May 22 2025 10:21:48
%S A306800 1,1,0,1,1,0,1,1,2,0,1,1,4,6,0,1,1,4,24,24,0,1,1,4,27,204,120,0,1,1,4,
%T A306800 27,252,2220,720,0,1,1,4,27,256,3020,29520,5040,0,1,1,4,27,256,3120,
%U A306800 44220,463680,40320,0,1,1,4,27,256,3125,46470,765030,8401680,362880,0
%N A306800 Square array whose entry A(n,k) is the number of endofunctions on a set of size n with preimage constraint {0,1,...,k}, for n >= 0, k >= 0, read by descending antidiagonals.
%C A306800 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.
%C A306800 Thus, A(n,k) is the number of endofunctions on a set of size n such that each preimage has at most k entries. Equivalently, A(n,k) is the number of n-letter words from an n-letter alphabet such that no letter appears more than k times.
%H A306800 Alois P. Heinz, <a href="/A306800/b306800.txt">Antidiagonals n = 0..140, flattened</a>
%H A306800 B. Otto, <a href="https://arxiv.org/abs/1903.00542">Coalescence under Preimage Constraints</a>, arXiv:1903.00542 [math.CO], 2019, Corollaries 5.6 and 7.8.
%F A306800 A(n,k) = n! * [x^n] 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^(-1/2) * r_k^-n. Stirling's approximation gives column k=1, and column k=0 is 0.
%F A306800 A(n,k) = Sum_{j=1..min(k,n)} A019575(n,j) for n>=1. - _Alois P. Heinz_, Jun 28 2023
%e A306800 Array begins:
%e A306800   1    1     1     1     1 ...
%e A306800   0    1     1     1     1 ...
%e A306800   0    2     4     4     4 ...
%e A306800   0    6    24    27    27 ...
%e A306800   0   24   204   252   256 ...
%e A306800   0  120  2220  3020  3120 ...
%e A306800   0  720 29520 44220 46470 ...
%e A306800   ...
%p A306800 b:= proc(n, i, k) option remember; `if`(n=0 and i=0, 1, `if`(i<1, 0,
%p A306800       add(b(n-j, i-1, k)*binomial(n, j), j=0..min(k, n))))
%p A306800     end:
%p A306800 A:= (n, k)-> b(n$2, k):
%p A306800 seq(seq(A(n, d-n), n=0..d), d=0..12);  # _Alois P. Heinz_, Apr 05 2019
%t A306800 b[n_, i_, k_] := b[n, i, k] = If[n==0 && i==0, 1, If[i<1, 0, Sum[b[n-j, i-1, k] Binomial[n, j], {j, 0, Min[k, n]}]]];
%t A306800 A[n_, k_] := b[n, n, k];
%t A306800 Table[A[n, d-n], {d, 0, 12}, {n, 0, d}] // Flatten (* _Jean-François Alcover_, May 29 2019, after _Alois P. Heinz_ *)
%o A306800 (Python)
%o A306800 # print first num_entries entries in column k
%o A306800 import math, sympy; x=sympy.symbols('x')
%o A306800 k=5; num_entries = 64
%o A306800 P=range(k+1); eP=sum([x**d/math.factorial(d) for d in P]); r = [1]; curr_pow = 1
%o A306800 for term in range(1,num_entries):
%o A306800    curr_pow=(curr_pow*eP).expand()
%o A306800    r.append(curr_pow.coeff(x**term)*math.factorial(term))
%o A306800 print(r)
%Y A306800 Columns 0-9: A000007, A000142, A012244, A239368, A324804, A324805, A324806, A324807, A324808, A324809.
%Y A306800 A(n,n) gives A000312.
%Y A306800 Similar array for preimage condition {i>=0 | i!=k}: A245413.
%Y A306800 Number of functions with preimage condition given by the even nonnegative integers: A209289.
%Y A306800 Sum over all k of the number of functions with preimage condition {0,k}: A231812.
%Y A306800 Cf. A019575.
%K A306800 easy,nonn,tabl
%O A306800 0,9
%A A306800 _Benjamin Otto_, Mar 10 2019
%E A306800 Offset changed to 0 by _Alois P. Heinz_, Jun 28 2023