login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A163590
Odd part of the swinging factorial A056040.
7
1, 1, 1, 3, 3, 15, 5, 35, 35, 315, 63, 693, 231, 3003, 429, 6435, 6435, 109395, 12155, 230945, 46189, 969969, 88179, 2028117, 676039, 16900975, 1300075, 35102025, 5014575, 145422675, 9694845, 300540195, 300540195, 9917826435, 583401555, 20419054425, 2268783825
OFFSET
0,4
COMMENTS
Let n$ denote the swinging factorial. a(n) = n$ / 2^sigma(n) where sigma(n) is the exponent of 2 in the prime-factorization of n$. sigma(n) can be computed as the number of '1's in the base 2 representation of floor(n/2).
If n is even then a(n) is the numerator of the reduced ratio (n-1)!!/n!! = A001147(n-1)/A000165(n), and if n is odd then a(n) is the numerator of the reduced ratio n!!/(n-1)!! = A001147(n)/A000165(n-1). The denominators for each ratio should be compared to A060818. Here all ratios are reduced. - Anthony Hernandez, Feb 05 2020 [See the Mathematica program for a more compact form of the formula. Peter Luschny, Mar 01 2020 ]
LINKS
FORMULA
a(2*n) = A001790(n).
a(2*n+1) = A001803(n).
a(n) = a(n-1)*n^((-1)^(n+1))*2^valuation(n, 2) for n > 0. - Peter Luschny, Sep 29 2019
EXAMPLE
11$ = 2772 = 2^2*3^2*7*11. Therefore a(11) = 3^2*7*11 = 2772/4 = 693.
From Anthony Hernandez, Feb 04 2019: (Start)
a(7) = numerator((1*3*5*7)/(2*4*6)) = 35;
a(8) = numerator((1*3*5*7)/(2*4*6*8)) = 35;
a(9) = numerator((1*3*5*7*9)/(2*4*6*8)) = 315;
a(10) = numerator((1*3*5*7*9)/(2*4*6*8*10)) = 63. (End)
MAPLE
swing := proc(n) option remember; if n = 0 then 1 elif irem(n, 2) = 1 then swing(n-1)*n else 4*swing(n-1)/n fi end:
sigma := n -> 2^(add(i, i= convert(iquo(n, 2), base, 2))):
a := n -> swing(n)/sigma(n);
MATHEMATICA
sf[n_] := With[{f = Floor[n/2]}, Pochhammer[f+1, n-f]/ f!]; a[n_] := With[{s = sf[n]}, s/2^IntegerExponent[s, 2]]; Table[a[n], {n, 0, 31}] (* Jean-François Alcover, Jul 26 2013 *)
r[n_] := (n - Mod[n - 1, 2])!! /(n - 1 + Mod[n - 1, 2])!! ;
Table[r[n], {n, 0, 36}] // Numerator (* Peter Luschny, Mar 01 2020 *)
PROG
(Sage) # uses[A000120]
@CachedFunction
def swing(n):
if n == 0: return 1
return swing(n-1)*n if is_odd(n) else 4*swing(n-1)/n
A163590 = lambda n: swing(n)/2^A000120(n//2)
[A163590(n) for n in (0..31)] # Peter Luschny, Nov 19 2012
# Alternatively:
(Sage)
@cached_function
def A163590(n):
if n == 0: return 1
return A163590(n - 1) * n^((-1)^(n + 1)) * 2^valuation(n, 2)
print([A163590(n) for n in (0..31)]) # Peter Luschny, Sep 29 2019
(PARI)
A163590(n) = {
my(a = vector(n+1)); a[1] = 1;
for(n = 1, n,
a[n+1] = a[n]*n^((-1)^(n+1))*2^valuation(n, 2));
a } \\ Peter Luschny, Sep 29 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Aug 01 2009
STATUS
approved