A187761 Number of maps f: [n] -> [n] with f(x)<=x and f(f(x)) = f(f(f(x))).
1, 1, 2, 6, 23, 106, 568, 3459, 23544, 176850, 1451253, 12904312, 123489888, 1264591561, 13790277294, 159466823794, 1948259002647, 25066729706582, 338670605492700, 4792623436607059, 70873649458154500, 1092969062435462254, 17543703470388927229, 292600906102204630092
Offset: 0
Examples
There are a(4)=23 such maps f: [0,1,2,3] -> [0,1,2,3], all 4-digit mixed-radix numbers [f(0), f(1), f(2), f(3)] where 0 <= f(k) <= k (rising factorial basis) except for [ 0 0 1 2 ], as f(3)=2 and f(f(3)) = f(2) = 1 != f(f(f(3))) = f(f(2)) = f(1) = 0. The exception corresponds to the tree 0 -- 1 -- 2 -- 3 (0 is the root), which can be identified with the map [1,2,3,4] -> [0,1,2,3] where f(k)=k-1.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..493
- Peter Luschny, The Bell transform
- Peter Luschny, Permutation Trees
- D. P. Walsh, Counting forests with Stirling and Bell numbers
Crossrefs
Programs
-
Maple
b:= proc(n, x, y) option remember; `if`(n=0, 1, b(n-1, x+1, y) +x*b(n-1, x, y+1) +y*b(n-1, x, y)) end: a:= n-> b(n, 0, 0): seq(a(n), n=0..25); # Alois P. Heinz, Jan 09 2013 # The function BellMatrix is defined in A264428. B := BellMatrix(n -> combinat:-bell(n), 24): seq(add(i, i=LinearAlgebra:-Row(B,n)), n=1..24); # Peter Luschny, Jan 23 2016 # alternative Maple program: b:= proc(n, h) option remember; `if`(min(n, h)=0, 1, add( binomial(n-1, j-1)*b(j-1, h-1)*b(n-j, h), j=1..n)) end: a:= n-> b(n, 2): seq(a(n), n=0..25); # Alois P. Heinz, Aug 21 2017
-
Mathematica
b[n_, x_, y_] := b[n, x, y] = If[n == 0, 1, b[n-1, x+1, y]+x*b[n-1, x, y+1]+y*b[n-1, x, y]]; a[n_] := b[n, 0, 0]; Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Feb 25 2014, after Alois P. Heinz *) Table[Sum[BellY[n, k, BellB[Range[n] - 1]], {k, 0, n}], {n, 0, 20}] (* Vladimir Reshetnikov, Nov 09 2016 *)
-
PARI
/* using e.g.f. A(x) */ x = 'x + O('x^66); B = exp( exp(x) - 1 ); /* e.g.f. of Bell numbers */ A = serconvol( x * B, -log(1-x) ); /* A = intformal(B) */ /* alternative to last line */ A = exp( A ); Vec( serlaplace( A ) )
-
Python
from sympy.core.cache import cacheit from sympy import binomial @cacheit def b(n, h): return 1 if min(n, h)==0 else sum([binomial(n - 1, j - 1)*b(j - 1, h - 1)*b(n - j, h) for j in range(1, n + 1)]) def a(n): return b(n, 2) print([a(n) for n in range(31)]) # Indranil Ghosh, Aug 21 2017, after second Maple program by Alois P. Heinz
Formula
Conjecture (confirmed below) about the e.g.f. A(x): Let B(x) = Sum_{n>=0} b(n) * x^n/n! = exp(exp(x)-1) the e.g.f. of the Bell numbers (A000110). Then A(x) = Sum_{n>=0} a(n) * x^n/n! = exp( Sum_{n>=0} b(n) * x^(n+1)/(n+1)! ), see PARI program.
From Joerg Arndt, Jan 14 2013: (Start)
Conjecture (confirmed below): Let C(0,x) = 1 and for k>=1 C(k, x) = exp( integral(C(k-1,x)) ) then C(k,x) is the e.g.f. for monotonic-labeled forests on n vertices with rooted trees of height less than k (column k of A179455(n,k) for k>=1, n>=k).
For k=1 (C(1,x)=exp(x)) and k=2 (C(2,x)=exp(exp(x)-1)) this is known to be true, for k=3 this is the conjecture above. (End)
From Joerg Arndt, Jan 15 2013: (Start)
Gareth McCaughan, on the math-fun mailing list (Jan 14 2013), writes
"If F is the e.g.f. for Things Of Size n, then exp(F) is the e.g.f. for Multisets Of Things Whose Sizes Add Up To n. (The factorials turn into multinomial coefficients.)
"Which means the conjecture is right. (The integral turns that into 'multisets of things whose sizes plus 1 add up to n'; a tree is a forest together with a new node on top.)"
(End)
Comments