login
A154030
Sequence defined by a(2*n) = 2*(n^2 + 2*n) and a(2*n-1) = (2*n)!/n!.
1
0, 2, 6, 12, 16, 120, 30, 1680, 48, 30240, 70, 665280, 96, 17297280, 126, 518918400, 160, 17643225600, 198, 670442572800, 240, 28158588057600, 286, 1295295050649600, 336, 64764752532480000, 390, 3497296636753920000, 448
OFFSET
0,2
LINKS
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
Sequence in context: A130237 A053457 A299112 * A055560 A237719 A369383
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Jan 04 2009
EXTENSIONS
Edited by G. C. Greubel, Feb 08 2021
STATUS
approved