OFFSET
0,2
LINKS
EXAMPLE
a(2) = 23 because the hafnian of
[d 2 3 5]
[2 d 2 3]
[3 2 d 2]
[5 3 2 d]
equals M_{1,2}*M_{3,4} + M_{1,3}*M_{2,4} + M_{1,4}*M_{2,3} = 2*2 + 3*3 + 5*2 = 23. Here d denotes the generic element on the main diagonal of the matrix from which the hafnian does not depend.
MATHEMATICA
M[i_, j_]:=Prime[Abs[i-j]]; a[n_]:=Sum[Product[M[Part[PermutationList[s, 2n], 2i-1], Part[PermutationList[s, 2n], 2i]], {i, n}], {s, SymmetricGroup[2n]//GroupElements}]/(n!*2^n); Array[a, 5, 0]
CROSSREFS
KEYWORD
nonn,hard,more,new
AUTHOR
Stefano Spezia, Feb 25 2025
EXTENSIONS
a(5)-a(10) from Pontus von Brömssen, Feb 26 2025
STATUS
approved