OFFSET
1,2
LINKS
Vaclav Kotesovec, Table of n, a(n) for n = 1..100 (terms 1..50 from Andrew Howroyd)
Andrew Howroyd, Formula for the number of cycles
Eric Weisstein's World of Mathematics, Complete Tripartite Graph
Eric Weisstein's World of Mathematics, Graph Cycle
FORMULA
Row sums of A296546.
a(n) ~ sqrt(3*Pi) * 2^(3*n - 1/2) * n^(3*n - 1/2) / exp(3*n - 3/2). - Vaclav Kotesovec, Feb 17 2024
MATHEMATICA
Table[(Sum[Binomial[n, k] Binomial[n, i + p] Binomial[n, j + p] Binomial[k, i] Binomial[k - i, j] (k - 1)! (i + p)! (j + p)! 2^(k - i - j) Binomial[p + i + j - 1, k - 1], {k, n}, {i, 0, k}, {j, 0, k - i}, {p, k - i - j, n}] + Sum[Binomial[n, k]^2 k! (k - 1)!, {k, 2, n}])/2 - n^2, {n, 10}] (* Eric W. Weisstein, May 26 2017 *)
Table[(n^2 (HypergeometricPFQ[{1, 1, 1 - n, 1 - n}, {2}, 1] - 3) + Sum[2^(k - i - j) Binomial[k, i] Binomial[k - i, j] Binomial[n, k] Binomial[n, i + p] Binomial[n, j + p] Binomial[i + j + p - 1, k - 1] (k - 1)! (i + p)! (j + p)!, {k, n}, {i, 0, k}, {j, 0, k - i}, {p, k - i - j, n}])/2, {n, 10}] (* Eric W. Weisstein, May 25 2023 *)
PROG
(PARI)
c(n, k, i, j, p) = {binomial(n, k)*binomial(n, i+p)*binomial(n, j+p)*binomial(k, i)*binomial(k-i, j)*(k-1)!*(i+p)!*(j+p)!*2^(k-i-j)*binomial(p+i+j-1, k-1)}
a(n)={(sum(k=1, n, sum(i=0, k, sum(j=0, k-i, sum(p=k-i-j, n, c(n, k, i, j, p) )))) + sum(k=2, n, binomial(n, k)^2*k!*(k-1)!))/2 - n^2} \\ Andrew Howroyd, May 25 2017
(Python)
from sympy import binomial, factorial
def c(n, k, i, j, p): return binomial(n, k)*binomial(n, i + p)*binomial(n, j + p)*binomial(k, i)*binomial(k - i, j)*factorial(k - 1)*factorial(i + p)*factorial(j + p)*2**(k - i - j)*binomial(p + i + j - 1, k - 1)
def a(n): return (sum([sum([sum([sum([c(n, k, i, j, p) for p in range(k - i - j, n + 1)]) for j in range(k - i + 1)]) for i in range(k + 1)]) for k in range(1, n + 1)]) + sum(binomial(n, k)**2*factorial(k)*factorial(k - 1) for k in range(2, n + 1)))/2 - n**2
print([a(k) for k in range(1, 13)]) # Indranil Ghosh, Aug 14 2017, after PARI
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric W. Weisstein, Dec 28 2013
EXTENSIONS
a(7)-a(12) from Andrew Howroyd, May 25 2017
STATUS
approved