OFFSET
0,5
COMMENTS
Number of permutations of [n] whose cycle lengths are squares. - Alois P. Heinz, May 12 2016
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..451
David Harry Richman and Andrew O'Desky, Derangements and the p-adic incomplete gamma function, arXiv:2012.04615 [math.NT], 2020.
Wikipedia, Liouville Function.
FORMULA
The e.g.f. A(x)=1+a(1)x+a(2)x^2/2!+... is equal to the power series expansion of the product of (1-x^n)^{-lambda(n)/n} (n=1,2,...) where lambda(n) is the Liouville function A008836 (follows easily from the Lambert series of lambda(n) - see e. g., the Wikipedia link). - Mamuka Jibladze, Jan 12 2014
a(0) = 1; a(n) = (n-1)! * Sum_{k=1..floor(sqrt(n))} a(n-k^2)/(n-k^2)!. - Seiichi Manyama, Apr 29 2022
EXAMPLE
E.g.f.: A(x) = 1 + x + x^2/2! + x^3/3! + 7*x^4/4! + 31*x^5/5! + 91*x^6/6! +...
where
log(A(x)) = x + x^4/4 + x^9/9 + x^16/16 + x^25/25 + x^36/36 +...
MAPLE
a:= proc(n) option remember; `if`(n=0, 1, add(`if`(issqr(j),
a(n-j)*(j-1)!*binomial(n-1, j-1), 0), j=1..n))
end:
seq(a(n), n=0..25); # Alois P. Heinz, May 12 2016
MATHEMATICA
a[n_] := a[n] = If[n==0, 1, Sum[If[IntegerQ @ Sqrt[j], a[n-j]*(j-1)! * Binomial[n-1, j-1], 0], {j, 1, n}]]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Feb 19 2017, after Alois P. Heinz *)
nmax = 25; CoefficientList[Series[Product[1/(1 - x^k)^(LiouvilleLambda[k]/k), {k, 1, nmax}], {x, 0, nmax}], x] * Range[0, nmax]! (* Vaclav Kotesovec, Nov 17 2019 *)
PROG
(PARI) {a(n)=n!*polcoeff(exp(sum(m=1, sqrtint(n+1), x^(m^2)/(m^2)+x*O(x^n))), n)}
(PARI) a(n) = if(n==0, 1, (n-1)!*sum(k=1, sqrtint(n), a(n-k^2)/(n-k^2)!)); \\ Seiichi Manyama, Apr 29 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Jan 31 2012
STATUS
approved