OFFSET
0,3
COMMENTS
x in {1,2,...,n} is a recurrent element if there is some k such that f^k(x) = x where f^k(x) denotes iterated functional composition. In other words, a recurrent element is in a cycle of the functional digraph. An element that is not recurrent is a nonrecurrent element.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..385
FORMULA
MAPLE
b:= proc(n) option remember; `if`(n=0, [1, 0], add((p->p+
[0, p[1]*j])((j-1)!*b(n-j)*binomial(n-1, j-1)), j=1..n))
end:
a:= n-> (p-> n*p[1]-p[2])(add(b(j)*n^(n-j)
*binomial(n-1, j-1), j=0..n)):
seq(a(n), n=0..25); # Alois P. Heinz, May 22 2016
MATHEMATICA
nn=20; f[list_] := Select[list, #>0&]; t=Sum[n^(n-1)x^n y^n/n!, {n, 1, nn}]; Range[0, nn]! CoefficientList[Series[D[1/(1-x Exp[t]), y]/.y->1, {x, 0, nn}], x]
PROG
(Python)
from math import comb
def A219706(n): return (n-1)*n**n-(sum(comb(n, k)*(n-k)**(n-k)*k**k for k in range(1, (n+1>>1)))<<1) - (0 if n&1 else comb(n, m:=n>>1)*m**n) if n else 0 # Chai Wah Wu, Apr 26 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Geoffrey Critzer, Nov 25 2012
STATUS
approved