OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..700
FORMULA
a(2*n) = 2*(n^2 + 2*n).
a(2*n-1) = (2*n)!/n!.
MATHEMATICA
Flatten[Table[{2*(n^2 - 1), (2*n)!/n!}, {n, 1, 20}]]
Table[If[EvenQ[n], 2*((n/2)^2 + n), (n+1)!/((n+1)/2)!], {n, 0, 30}] (* G. C. Greubel, Feb 08 2021 *)
PROG
(PARI) a(n)=if(n%2, (n+1)!/((n+1)/2)!, 2*(n/2)^2 + 2*n) \\ Charles R Greathouse IV, Sep 01 2016
(Sage)
def A154030(n):
if (n%2==0): return 2*((n/2)^2 + n)
else: return factorial(n+1)/factorial((n+1)/2)
[A154030(n) for n in (0..30)] # G. C. Greubel, Feb 08 2021
(Magma) [ n mod 2 eq 0 select 2*((n/2)^2 + n) else Round(Factorial(n+1)/Gamma((n+3)/2)): n in [0..30]]; // G. C. Greubel, Feb 08 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Jan 04 2009
EXTENSIONS
Edited by G. C. Greubel, Feb 08 2021
STATUS
approved