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.

Showing 1-10 of 146 results. Next

A180000 a(n) = lcm{1,2,...,n} / swinging_factorial(n) = A003418(n) / A056040(n).

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 3, 12, 4, 10, 10, 30, 30, 105, 7, 56, 56, 252, 252, 1260, 60, 330, 330, 1980, 396, 2574, 286, 2002, 2002, 15015, 15015, 240240, 7280, 61880, 1768, 15912, 15912, 151164, 3876, 38760, 38760, 406980, 406980, 4476780, 99484, 1144066
Offset: 0

Views

Author

Peter Luschny, Aug 17 2010

Keywords

Comments

Characterization: Let e_{p}(m) denote the exponent of the prime p in the prime factorization of m and [.] denote the Iverson bracket, then
e_{p}(a(n)) = Sum_{k>=1} [floor(n/p^k) is even].
This implies, among other things, that no prime > floor(n/2) can divide a(n). The prime exponents e_{2}(a(2n)) give Guy Steele's sequence GS(5,3) A080100.
Asymptotics: log a(n) ~ n(1 - log 2). It is conjectured that log a(n) ~ n(1 - log 2) + O(n^{1/2+eps}) for all eps > 0.
Bounds: A056040(floor(n/3)) <= a(n) <= A056040(floor(n/2)) if n >= 285.

Crossrefs

Programs

  • Maple
    a := proc(n) local A014963, k;
    A014963 := proc(n) if n < 2 then 1 else numtheory[factorset](n);
    if 1 < nops(%) then 1 else op(%) fi fi end;
    mul(A014963(k)*(k/2)^((-1)^k), k=1..n)/2^n end;
    # Also:
    A180000 := proc(n) local lcm, sf;
    lcm := ilcm(seq(i,i=1..n));
    sf := n!/iquo(n,2)!^2;
    lcm/sf end;
  • Mathematica
    a[0] = 1; a[n_] := LCM @@ Range[n] / (n! / Floor[n/2]!^2); Table[a[n], {n, 0, 46}] (* Jean-François Alcover, Jul 23 2013 *)
  • PARI
    L=1; X(n)={ ispower(n, , &n);if(isprime(n),n,1); }
    Y(n)={ a=X(n); b=if(bitand(1,n),a,a*(n/2)^2); L=(b*L)/n; }
    A180000_list(n)={ L=1; vector(n,m,Y(m)); }  \\ for n>0
    
  • Sage
    def Exp(m,n) :
        s = 0; p = m; q = n//p
        while q > 0 :
            if is_even(q) :
                s = s + 1
            p = p * m
            q = n//p
        return s
    def A180000(n) :
        A = [1,1,1,1,2,2,3,3,12]
        if n < 9 : return A[n]
        R = []; r = isqrt(n)
        P = Primes(); p = P.first()
        while p <= n//2 :
            if p <= r : R.append(p^Exp(p,n))
            elif p <= n//3 :
                if is_even(n//p) : R.append(p)
            else : R.append(p)
            p = P.next(p)
        return mul(x for x in R)

Formula

a(n) = 2^(-n)*Product_{1<=k<=n} A014963(k)*(k/2)^((-1)^k).

A163085 Product of first n swinging factorials (A056040).

Original entry on oeis.org

1, 1, 2, 12, 72, 2160, 43200, 6048000, 423360000, 266716800000, 67212633600000, 186313420339200000, 172153600393420800000, 2067909047925770649600000, 7097063852481244869427200000
Offset: 0

Views

Author

Peter Luschny, Jul 21 2009

Keywords

Comments

With the definition of the Hankel transform as given by Luschny (see link) which uniquely determines the original sequence (provided that all determinants are not zero) this is also 1/ the Hankel determinant of 1/(n+1) (assuming (0,0)-based matrices).
a(2*n-1) is 1/determinant of the Hilbert matrix H(n) (A005249).
a(2*n) = A067689(n). - Peter Luschny, Sep 18 2012

Crossrefs

Programs

  • Maple
    a := proc(n) local i; mul(A056040(i),i=0..n) end;
  • Mathematica
    a[0] = 1; a[n_] := a[n] = a[n-1]*n!/Floor[n/2]!^2; Table[a[n], {n, 0, 14}] (* Jean-François Alcover, Jun 26 2013 *)
  • Sage
    def A056040(n):
        swing = lambda n: factorial(n)/factorial(n//2)^2
        return mul(swing(i) for i in (0..n))
    [A056040(i) for i in (0..14)] # Peter Luschny, Sep 18 2012

A163650 Subswing - the inverse binomial transform of the swinging factorial (A056040).

Original entry on oeis.org

1, 0, 1, 2, -9, 44, -165, 594, -2037, 6824, -22437, 72830, -234047, 746316, -2364947, 7455798, -23405085, 73207728, -228275949, 709906518, -2202557691, 6819616020, -21076580511, 65032888998, -200369138571, 616531573224, -1894784517675, 5816886949874
Offset: 0

Views

Author

Peter Luschny, Aug 02 2009

Keywords

Comments

Analog to the subfactorial A000166.

Crossrefs

Row sums of A163649. Cf. A056040, A000166.

Programs

  • Maple
    a := proc(n) local k: add((-1)^(n-k)*binomial(n,k)*(k!/iquo(k,2)!^2), k=0..n) end:
  • Mathematica
    sf[n_] := n!/Quotient[n, 2]!^2; a[n_] := Sum[(-1)^(n-k)*Binomial[n, k]*sf[k], {k, 0, n}]; Table[a[n], {n, 0, 27}] (* Jean-François Alcover, Jun 28 2013 *)
  • PARI
    for(n=0,50, print1(sum(k=0,n, (-1)^(n-k)*binomial(n,k)*(k!/((k\2)!)^2)), ", ")) \\ G. C. Greubel, Aug 01 2017

Formula

E.g.f.: exp(-x)*BesselI(0,2*x)*(1+x). - Peter Luschny, Aug 26 2012
a(n) = Sum_{k=0..n} (-1)^(n-k) * binomial(n,k)*(k!/(floor(k/2)!)^2). - G. C. Greubel, Aug 01 2017
a(n) ~ -(-1)^n * sqrt(n) * 3^(n - 1/2) / (2*sqrt(Pi)). - Vaclav Kotesovec, Oct 31 2017
D-finite with recurrence n*a(n) +5*(n-1)*a(n-1) +(n-4)*a(n-2) +(-13*n+23)*a(n-3) +6*(n-3)*a(n-4)=0. - R. J. Mathar, Jul 04 2023

A246661 Run Length Transform of swinging factorials (A056040).

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 6, 1, 1, 1, 2, 2, 2, 6, 6, 1, 1, 1, 2, 1, 1, 2, 6, 2, 2, 2, 4, 6, 6, 6, 30, 1, 1, 1, 2, 1, 1, 2, 6, 1, 1, 1, 2, 2, 2, 6, 6, 2, 2, 2, 4, 2, 2, 4, 12, 6, 6, 6, 12, 6, 6, 30, 20, 1, 1, 1, 2, 1, 1, 2, 6, 1, 1, 1, 2, 2, 2, 6, 6, 1, 1, 1, 2, 1, 1
Offset: 0

Views

Author

Peter Luschny, Sep 07 2014

Keywords

Comments

For the definition of the Run Length Transform see A246595.

Crossrefs

Programs

  • Mathematica
    f[n_] := n!/Quotient[n, 2]!^2; Table[Times @@ (f[Length[#]]&) /@ Select[ Split[ IntegerDigits[n, 2]], #[[1]] == 1&], {n, 0, 85}] (* Jean-François Alcover, Jul 11 2017 *)
  • Python
    # use RLT function from A278159
    from math import factorial
    def A246661(n): return RLT(n,lambda m: factorial(m)//factorial(m//2)**2) # Chai Wah Wu, Feb 04 2022
  • Sage
    # uses[RLT from A246660]
    A246661_list = lambda len: RLT(lambda n: factorial(n)/factorial(n//2)^2, len)
    A246661_list(88)
    

Formula

a(2^n-1) = n$ where n$ is the swinging factorial of n, A056040(n).

A163210 Swinging Wilson quotients ((p-1)$ +(-1)^floor((p+2)/2))/p, p prime. Here '$' denotes the swinging factorial function (A056040).

Original entry on oeis.org

1, 1, 1, 3, 23, 71, 757, 2559, 30671, 1383331, 5003791, 245273927, 3362110459, 12517624987, 175179377183, 9356953451851, 509614686432899, 1938763632210843, 107752663194272623
Offset: 1

Views

Author

Peter Luschny, Jul 24 2009

Keywords

Examples

			The 5th prime is 11, (11-1)$ = 252, the remainder term is (-1)^floor((11+2)/2)=1. So the quotient (252+1)/11 = 23 is the 5th member of the sequence.
		

Crossrefs

Programs

  • 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:
    WQ := proc(f,r,n) map(p->(f(p-1)+r(p))/p,select(isprime,[$1..n])) end:
    A163210 := n -> WQ(swing,p->(-1)^iquo(p+2,2),n);
  • Mathematica
    sf[n_] := n!/Quotient[n, 2]!^2; a[n_] := (p = Prime[n]; (sf[p - 1] + (-1)^Floor[(p + 2)/2])/p); Table[a[n], {n, 1, 19}] (* Jean-François Alcover, Jun 28 2013 *)
    a[p_] := (Binomial[p-1, (p-1)/2] - (-1)^((p-1)/2)) / p
    Join[{1, 1}, a[Prime[Range[3,20]]]] (* Peter Luschny, May 13 2017 *)
  • PARI
    a(n, p=prime(n)) = ((p-1)!/((p-1)\2)!^2 - (-1)^(p\2))/p \\ David A. Corneth, May 13 2017

A163590 Odd part of the swinging factorial A056040.

Original entry on oeis.org

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

Views

Author

Peter Luschny, Aug 01 2009

Keywords

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 ]

Examples

			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)
		

Crossrefs

Programs

  • 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 *)
  • 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
  • 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
    

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

A163771 Triangle interpolating the swinging factorial (A056040) restricted to even indices with its binomial inverse. Same as interpolating the central trinomial coefficients (A002426) with the central binomial coefficients (A000984).

Original entry on oeis.org

1, 1, 2, 3, 4, 6, 7, 10, 14, 20, 19, 26, 36, 50, 70, 51, 70, 96, 132, 182, 252, 141, 192, 262, 358, 490, 672, 924, 393, 534, 726, 988, 1346, 1836, 2508, 3432, 1107, 1500, 2034, 2760, 3748, 5094, 6930, 9438, 12870
Offset: 0

Views

Author

Peter Luschny, Aug 05 2009

Keywords

Comments

Triangle read by rows. For n >= 0, k >= 0 let T(n,k) = Sum_{i=k..n} (-1)^(n-i)*binomial(n-k,n-i)*(2i)$ where i$ denotes the swinging factorial of i (A056040).
This is also the square array of central binomial coefficients A000984 in column 0 and higher (first: A051924, second, etc.) differences in subsequent columns, read by antidiagonals. - M. F. Hasler, Nov 15 2019

Examples

			Triangle begins
    1;
    1,   2;
    3,   4,   6;
    7,  10,  14,  20;
   19,  26,  36,  50,  70;
   51,  70,  96, 132, 182, 252;
  141, 192, 262, 358, 490, 672, 924;
From _M. F. Hasler_, Nov 15 2019: (Start)
The square array having central binomial coefficients A000984 in column 0 and higher differences in subsequent columns (col. 1 = A051924) starts:
     1   1    3    7    19    51 ...
     2   4   10   26    70   192 ...
     6  14   36   96   262   726 ...
    20  50  132  358   988  2760 ...
    70 182  490 1346  3748 10540 ...
   252 672 1836 5094 14288 40404 ...
  (...)
Read by falling antidiagonals this yields the same sequence. (End)
		

Crossrefs

Programs

  • Maple
    For the functions 'DiffTria' and 'swing' see A163770. Computes n rows of the triangle.
    a := n -> DiffTria(k->swing(2*k),n,true);
  • Mathematica
    sf[n_] := n!/Quotient[n, 2]!^2; t[n_, k_] := Sum[(-1)^(n - i)*Binomial[n - k, n - i]*sf[2*i], {i, k, n}]; Table[t[n, k], {n, 0, 8}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 28 2013 *)

A163074 Swinging primes: primes which are within 1 of a swinging factorial (A056040).

Original entry on oeis.org

2, 3, 5, 7, 19, 29, 31, 71, 139, 251, 631, 3433, 12011, 48619, 51479, 51481, 2704157, 155117519, 280816201, 4808643121, 35345263801, 81676217699, 1378465288199, 2104098963721, 5651707681619, 94684453367401, 386971244197199, 1580132580471899, 1580132580471901
Offset: 1

Views

Author

Peter Luschny, Jul 21 2009

Keywords

Comments

Union of A163075 and A163076.

Examples

			3$ + 1 = 7 is prime, so 7 is in the sequence. (Here '$' denotes the swinging factorial function.)
		

Crossrefs

Programs

  • Maple
    # Seq with arguments <= n:
    a := proc(n) select(isprime,map(x -> A056040(x)+1,[$1..n]));
    select(isprime,map(x -> A056040(x)-1,[$1..n]));
    sort(convert(convert(%%,set) union convert(%,set),list)) end:
  • Mathematica
    Reap[Do[f = n!/Quotient[n, 2]!^2; If[PrimeQ[p = f - 1], Sow[p]]; If[PrimeQ[p = f + 1], Sow[p]], {n, 1, 45}]][[2, 1]] // Union (* Jean-François Alcover, Jun 28 2013 *)

Extensions

More terms from Jinyuan Wang, Mar 22 2020

A163075 Primes of the form k$ + 1. Here '$' denotes the swinging factorial function (A056040).

Original entry on oeis.org

2, 3, 7, 31, 71, 631, 3433, 51481, 2704157, 280816201, 4808643121, 35345263801, 2104098963721, 94684453367401, 1580132580471901, 483701705079089804581, 6892620648693261354601, 410795449442059149332177041, 2522283613639104833370312431401
Offset: 1

Views

Author

Peter Luschny, Jul 21 2009

Keywords

Examples

			Since 3$ = 4$ = 6 the prime 7 is listed, however only once.
		

Crossrefs

Cf. A056040, A088332, A163077 (arguments k), A163074, A163076.

Programs

  • Maple
    a := proc(n) select(isprime, map(x -> A056040(x)+1,[$1..n])) end:
  • Mathematica
    Reap[Do[f = n!/Quotient[n, 2]!^2; If[PrimeQ[p = f + 1], Sow[p]], {n, 1, 70}]][[2, 1]] // Union (* Jean-François Alcover, Jun 28 2013 *)

Extensions

More terms from Jinyuan Wang, Mar 22 2020

A163772 Triangle interpolating the swinging factorial (A056040) restricted to odd indices with its binomial inverse. Triangle read by rows. For n >= 0, k >= 0.

Original entry on oeis.org

1, 5, 6, 19, 24, 30, 67, 86, 110, 140, 227, 294, 380, 490, 630, 751, 978, 1272, 1652, 2142, 2772, 2445, 3196, 4174, 5446, 7098, 9240, 12012, 7869, 10314, 13510, 17684, 23130, 30228, 39468, 51480
Offset: 0

Views

Author

Peter Luschny, Aug 05 2009

Keywords

Examples

			Triangle begins:
     1;
     5,    6;
    19,   24,   30;
    67,   86,  110,  140;
   227,  294,  380,  490,  630;
   751,  978, 1272, 1652, 2142, 2772;
  2445, 3196, 4174, 5446, 7098, 9240, 12012;
		

Crossrefs

Programs

  • Maple
    For the functions 'DiffTria' and 'swing' see A163770. Computes n rows of the triangle.
    a := n -> DiffTria(k->swing(2*k+1),n,true);
  • Mathematica
    sf[n_] := n!/Quotient[n, 2]!^2; t[n_, k_] := Sum[ (-1)^(n-i)*Binomial[n-k, n-i]*sf[2*i+1], {i, k, n}]; Table[t[n, k], {n, 0, 7}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 28 2013 *)

Formula

T(n,k) = Sum_{i=k..n} (-1)^(n-i)*binomial(n-k,n-i)*(2i+1)$ where i$ denotes the swinging factorial of i (A056040).
Showing 1-10 of 146 results. Next