OFFSET
0,3
COMMENTS
This sequence gives the expectation of the second moment of a random symmetric sign matrix of size n X n.
REFERENCES
Zelin Lv, On The Moments of Random Determinants, Master Thesis, the University of Chicago.
I. G. Zhurbenko, Moments of random determinants, Theory of Probability & Its Application, 13(4):682-686, 1968.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..448
FORMULA
f^(sym)_2(n) = q(n) * (n-1)!, where
p(n) =
1, if n <= 2
2, if n >= 3 and n is odd
3, if n >= 4 and n is even
q(n) = p(n) + Sum_{i=1..n-1}(p(i) * q(n-i)) / (n-i).
E.g.f.: exp(-x*(x+1))/sqrt((x+1)*(1-x)^5). - Alois P. Heinz, Apr 19 2023
a(n) ~ 4*n^(n+2)/ (3*exp(n+2)). - Vaclav Kotesovec, Apr 20 2023
a(n) = (p(n) + Sum_{i=1..n-1} p(n-i) * a(i)/i! ) * (n-1)!. - Chai Wah Wu, Apr 20 2023
MAPLE
a:= n-> `if`(n=0, 1, q(n)*(n-1)!):
p:= n-> `if`(n<3, 1, 3-irem(n, 2)):
q:= proc(n) option remember;
p(n)+add(p(n-i)*q(i)/i, i=1..n-1)
end:
seq(a(n), n=0..21); # Alois P. Heinz, Apr 19 2023
PROG
(SageMath)
x = LazyPowerSeriesRing(QQ, "x").gen()
egf = exp(-x * (x + 1)) / sqrt((x + 1) * (1 - x)^5)
[egf[n] * factorial(n) for n in range(22)] # Peter Luschny, Apr 20 2023
(Python)
from math import factorial
from fractions import Fraction
from functools import lru_cache
@lru_cache(maxsize=None)
def A362413(n): return int(((1 if n<=2 else (2 if n&1 else 3))+sum(Fraction((1 if n-i<=2 else (2 if n-i&1 else 3))*A362413(i), factorial(i)) for i in range(1, n)))*factorial(n-1)) if n else 1 # Chai Wah Wu, Apr 20 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Zelin Lv, Apr 18 2023
STATUS
approved