cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A163590 Odd part of the swinging factorial A056040.

This page as a plain text file.
%I A163590 #43 May 08 2020 17:33:00
%S A163590 1,1,1,3,3,15,5,35,35,315,63,693,231,3003,429,6435,6435,109395,12155,
%T A163590 230945,46189,969969,88179,2028117,676039,16900975,1300075,35102025,
%U A163590 5014575,145422675,9694845,300540195,300540195,9917826435,583401555,20419054425,2268783825
%N A163590 Odd part of the swinging factorial A056040.
%C A163590 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).
%C A163590 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 ]
%H A163590 G. C. Greubel, <a href="/A163590/b163590.txt">Table of n, a(n) for n = 0..1000</a>
%H A163590 Peter Luschny, <a href="/A180000/a180000.pdf">Die schwingende Fakultät und Orbitalsysteme</a>, August 2011.
%H A163590 Peter Luschny, <a href="http://luschny.de/math/factorial/SwingIntro.pdf">Swinging Factorial.</a>
%F A163590 a(2*n) = A001790(n).
%F A163590 a(2*n+1) = A001803(n).
%F A163590 a(n) = a(n-1)*n^((-1)^(n+1))*2^valuation(n, 2) for n > 0. - _Peter Luschny_, Sep 29 2019
%e A163590 11$ = 2772 = 2^2*3^2*7*11. Therefore a(11) = 3^2*7*11 = 2772/4 = 693.
%e A163590 From _Anthony Hernandez_, Feb 04 2019: (Start)
%e A163590 a(7) = numerator((1*3*5*7)/(2*4*6)) = 35;
%e A163590 a(8) = numerator((1*3*5*7)/(2*4*6*8)) = 35;
%e A163590 a(9) = numerator((1*3*5*7*9)/(2*4*6*8)) = 315;
%e A163590 a(10) = numerator((1*3*5*7*9)/(2*4*6*8*10)) = 63. (End)
%p A163590 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:
%p A163590 sigma := n -> 2^(add(i,i= convert(iquo(n,2),base,2))):
%p A163590 a := n -> swing(n)/sigma(n);
%t A163590 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 *)
%t A163590 r[n_] := (n - Mod[n - 1, 2])!! /(n - 1 + Mod[n - 1, 2])!! ;
%t A163590 Table[r[n], {n, 0, 36}] // Numerator (* _Peter Luschny_, Mar 01 2020 *)
%o A163590 (Sage) # uses[A000120]
%o A163590 @CachedFunction
%o A163590 def swing(n):
%o A163590     if n == 0: return 1
%o A163590     return swing(n-1)*n if is_odd(n) else 4*swing(n-1)/n
%o A163590 A163590 = lambda n: swing(n)/2^A000120(n//2)
%o A163590 [A163590(n) for n in (0..31)]  # _Peter Luschny_, Nov 19 2012
%o A163590 # Alternatively:
%o A163590 (Sage)
%o A163590 @cached_function
%o A163590 def A163590(n):
%o A163590     if n == 0: return 1
%o A163590     return A163590(n - 1) * n^((-1)^(n + 1)) * 2^valuation(n, 2)
%o A163590 print([A163590(n) for n in (0..31)]) # _Peter Luschny_, Sep 29 2019
%o A163590 (PARI)
%o A163590 A163590(n) = {
%o A163590     my(a = vector(n+1)); a[1] = 1;
%o A163590     for(n = 1, n,
%o A163590         a[n+1] = a[n]*n^((-1)^(n+1))*2^valuation(n, 2));
%o A163590 a } \\ _Peter Luschny_, Sep 29 2019
%Y A163590 Cf. A056040, A060632, A001790, A001803.
%K A163590 nonn
%O A163590 0,4
%A A163590 _Peter Luschny_, Aug 01 2009