OFFSET
0,2
LINKS
Indranil Ghosh, Table of n, a(n) for n = 0..400
G. N. Bakare, S. O. Makanjuola, Some Results on Properties of Alternating Semigroups, Nigerian Journal of Mathematics and Applications Volume 24,(2015), 184-192.
FORMULA
Bakare et al. give a formula, see Theorem 3.2.
EXAMPLE
Row 3 of triangle A283321: 1, 3, 3, 9. So a(3) = 1 + 3 + 3 + 9 = 22. - Indranil Ghosh, Mar 16 2017
MATHEMATICA
T[n_, k_]:=If[k==n, (n !/2), If[k==n - 1, n^2*(n - 1)!/2, Binomial[n, k]^2 * k !]]; t[n_, k_]:=If[n<2, 1, T[n, k]]; For[n=0, n<=20, Print[Sum[t[n, k], {k, 0, n}], " "]; n++] (* Indranil Ghosh, Mar 16 2017 *)
PROG
(PARI) T(n, k) = if(k==n, (n!/2), if(k==n - 1, n^2*(n - 1)!/2, binomial(n, k)^2 * k!));
t(n, k) = if(n<2, 1, T(n, k));
{for(n=0, 21, print1(sum(k=0, n, t(n, k)), ", "))} \\ Indranil Ghosh, Mar 16 2017
(Python)
import math
f=math.factorial
def C(n, r): return f(n)/f(r)/f(n - r)
def T(n, k):
....if k==n: return f(n)/2
....elif k==n-1: return n**2 * f(n - 1) / 2
....else: return C(n, k)**2 * f(k)
i=0
l=[]
for n in range(0, 401):
....for k in range(0, n+1):
........if n<2: l+=[1, ]
........else: l+=[T(n, k), ]
....print str(i)+" "+str(sum(l))
....l=[]
....i+=1 # Indranil Ghosh, Mar 16 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Mar 15 2017
STATUS
approved