%I #50 Jan 13 2024 12:53:51
%S 0,0,2,6,20,40,78,126,200,288,410,550,732,936,1190,1470,1808,2176,
%T 2610,3078,3620,4200,4862,5566,6360,7200,8138,9126,10220,11368,12630,
%U 13950,15392,16896,18530,20230,22068,23976,26030,28158,30440,32800,35322,37926,40700
%N a(n) = n*(2*(n - 2)*n + (-1)^n + 3)/4.
%C For n > 1, a(n) is the superdiagonal sum of the matrix M(n) whose permanent is A322277(n).
%C All the terms of this sequence are even numbers (A005843), but do not end with 4.
%H Stefano Spezia, <a href="/A323724/b323724.txt">Table of n, a(n) for n = 0..10000</a>
%H Christian Krause, <a href="https://github.com/ckrause/loda">LODA, an assembly language, a computational model and a tool for mining integer sequences</a>
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (2,1,-4,1,2,-1).
%F O.g.f.: 2*x^2*(1 + x + 3*x^2 + x^3)/((1 - x)^4*(1 + x)^2).
%F E.g.f.: (1/2)*x*(exp(x)*x*(1 + x) + sinh(x)).
%F a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6) for n > 5.
%F a(n) = (1/2)*(-1 + n)^2*n - (-1 + n)*floor(n/2) + 2*floor(n/2)^2.
%F a(n) = (1/2)*(-1 + n)^2*n - (-1 + n)*A004526(n) + 2*A000290(A004526(n)).
%F a(n) = (n/2)*((n - 1)^2 + 1) for even n; a(n) = (n/2)*(n - 1)^2 otherwise. - _Bruno Berselli_, Feb 06 2019
%F a(n) = 2*A004526(n*A000982(n-1)). [Found by _Christian Krause_'s LODA miner] - _Stefano Spezia_, Dec 12 2021
%F a(n) = 2*A005997(n-1) for n >= 2. - _Hugo Pfoertner_, Dec 13 2021
%p a:=n->(1/2)*(-1 + n)^2*n - (-1 + n)*floor(n/2) + 2*(floor(n/2))^2: seq(a(n), n=0..50);
%t a[n_] := 1/2 (-1 + n)^2 n - (-1 + n) Floor[n/2] + 2 Floor[n/2]^2; Array[a, 50, 0];
%t Table[n (2 (n - 2) n + (-1)^n + 3)/4, {n, 0, 50}] (* _Bruno Berselli_, Feb 06 2019 *)
%t LinearRecurrence[{2,1,-4,1,2,-1},{0,0,2,6,20,40},50] (* _Harvey P. Dale_, Jan 13 2024 *)
%o (GAP) Flat(List([0..50], n->(1/2)*(-1 + n)^2*n - (-1 + n)*Int(n/2) + 2*(Int(n/2))^2));
%o (Magma) [(1/2)*(-1 + n)^2*n - (-1 + n)*Floor(n/2) + 2*(Floor(n/2))^2: n in [0..50]];
%o (Maxima) makelist((1/2)*(-1 + n)^2*n - (-1 + n)*floor(n/2) + 2*(floor(n/2))^2, n, 0, 50);
%o (PARI) a(n) = (1/2)*(-1 + n)^2*n - (-1 + n)*floor(n/2) + 2*(floor(n/2))^2;
%o (PARI) T(i,j,n) = if (i %2, j + n*(i-1), n*i - j + 1);
%o a(n) = sum(k=1, n-1, T(k,k+1,n)); \\ _Michel Marcus_, Feb 06 2019
%o (Python) [int((1/2)*(-1 + n)**2*n - (-1 + n)*int(n/2) + 2*(int(n/2))**2) for n in range(0,50)]
%Y Cf. A000290, A000982, A004526, A005843, A005997, A317614, A322277, A323723, A325516.
%K nonn,easy
%O 0,3
%A _Stefano Spezia_, Jan 25 2019
%E Definition by _Bruno Berselli_, Feb 06 2019