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-9 of 9 results.

A052841 Expansion of e.g.f.: 1/(exp(x)*(2-exp(x))).

Original entry on oeis.org

1, 0, 2, 6, 38, 270, 2342, 23646, 272918, 3543630, 51123782, 811316286, 14045783798, 263429174190, 5320671485222, 115141595488926, 2657827340990678, 65185383514567950, 1692767331628422662, 46400793659664205566, 1338843898122192101558, 40562412499252036940910
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

From Michael Somos, Mar 04 2004: (Start)
Stirling transform of A005359(n)=[0,2,0,24,0,720,...] is a(n)=[0,2,6,38,270,...].
Stirling transform of -(-1)^n*A052657(n-1)=[0,0,2,-6,48,-240,...] is a(n-1)=[0,0,2,6,38,270,...].
Stirling transform of -(-1)^n*A052558(n-1)=[1,-1,4,-12,72,-360,...] is a(n-1)=[1,0,2,6,38,270,...].
Stirling transform of 2*A052591(n)=[2,4,24,96,...] is a(n+1)=[2,6,38,270,...].
(End)
Also the central moments of a Geometric(1/2) random variable (for example the number of coin tosses until the first head). - Svante Janson, Dec 10 2012
Also the number of ordered set partitions of {1..n} with no cyclical adjacencies (successive elements in the same block, where 1 is a successor of n). - Gus Wiseman, Feb 13 2019
Also the number of ordered set partitions of {1..n} with an even number of blocks. - Geoffrey Critzer, Jul 04 2020

Examples

			From _Gus Wiseman_, Feb 13 2019: (Start)
The a(4) = 38 ordered set partitions with no cyclical adjacencies:
  {{1}{2}{3}{4}}  {{1}{24}{3}}  {{13}{24}}
  {{1}{2}{4}{3}}  {{1}{3}{24}}  {{24}{13}}
  {{1}{3}{2}{4}}  {{13}{2}{4}}
  {{1}{3}{4}{2}}  {{13}{4}{2}}
  {{1}{4}{2}{3}}  {{2}{13}{4}}
  {{1}{4}{3}{2}}  {{2}{4}{13}}
  {{2}{1}{3}{4}}  {{24}{1}{3}}
  {{2}{1}{4}{3}}  {{24}{3}{1}}
  {{2}{3}{1}{4}}  {{3}{1}{24}}
  {{2}{3}{4}{1}}  {{3}{24}{1}}
  {{2}{4}{1}{3}}  {{4}{13}{2}}
  {{2}{4}{3}{1}}  {{4}{2}{13}}
  {{3}{1}{2}{4}}
  {{3}{1}{4}{2}}
  {{3}{2}{1}{4}}
  {{3}{2}{4}{1}}
  {{3}{4}{1}{2}}
  {{3}{4}{2}{1}}
  {{4}{1}{2}{3}}
  {{4}{1}{3}{2}}
  {{4}{2}{1}{3}}
  {{4}{2}{3}{1}}
  {{4}{3}{1}{2}}
  {{4}{3}{2}{1}}
(End)
		

Crossrefs

Main diagonal of A122101.
Inverse binomial transform of A000670.

Programs

  • Magma
    R:=PowerSeriesRing(Rationals(), 40);
    Coefficients(R!(Laplace( Exp(-x)/(2-Exp(x)) ))); // G. C. Greubel, Jun 11 2024
    
  • Maple
    spec := [S,{B=Prod(C,C),C=Set(Z,1 <= card),S=Sequence(B)},labeled]: seq(combstruct[count](spec,size=n), n=0..20);
    P := proc(n,x) option remember; if n = 0 then 1 else
    (n*x+2*(1-x))*P(n-1,x)+x*(1-x)*diff(P(n-1,x),x); expand(%) fi end:
    A052841 := n -> subs(x=2, P(n,x)):
    seq(A052841(n), n=0..21); # Peter Luschny, Mar 07 2014
    h := n -> add(combinat:-eulerian1(n, k)*2^k, k=0..n):
    a := n -> (h(n)+(-1)^n)/2: seq(a(n), n=0..21); # Peter Luschny, Sep 19 2015
    b := proc(n, m) option remember; if n = 0 then 1 else
         (m - 1)*b(n - 1, m) + (m + 1)*b(n - 1, m + 1) fi end:
    a := n -> b(n, 0): seq(a(n), n = 0..21); # Peter Luschny, Jun 23 2023
  • Mathematica
    a[n_] := If[n == 0, 1, (PolyLog[-n, 1/2]/2 + (-1)^n)/2]; (* or *)
    a[n_] := HurwitzLerchPhi[1/2, -n, -1]/2; Table[a[n], {n, 0, 21}] (* Jean-François Alcover, Feb 19 2016, after Vladeta Jovovic *)
    With[{nn=30},CoefficientList[Series[1/(Exp[x](2-Exp[x])),{x,0,nn}],x] Range[ 0,nn]!] (* Harvey P. Dale, Apr 08 2019 *)
  • PARI
    a(n)=if(n<0,0,n!*polcoeff(subst(1/(1-y^2),y,exp(x+x*O(x^n))-1),n))
    
  • PARI
    {a(n)=polcoeff(sum(m=0,n,(2*m)!*x^(2*m)/prod(k=1,2*m,1-k*x+x*O(x^n))),n)} /* Paul D. Hanna, Jul 20 2011 */
    
  • SageMath
    def A052841_list(prec):
        P. = PowerSeriesRing(QQ, prec)
        return P( exp(-x)/(2-exp(x)) ).egf_to_ogf().list()
    A052841_list(40) # G. C. Greubel, Jun 11 2024

Formula

O.g.f.: Sum_{n>=0} (2*n)! * x^(2*n) / Product_{k=1..2*n} (1-k*x). - Paul D. Hanna, Jul 20 2011
a(n) = (A000670(n) + (-1)^n)/2 = Sum_{k>=0} (k-1)^n/2^(k+1). - Vladeta Jovovic, Feb 02 2003
Also, a(n) = Sum_{k=0..[n/2]} (2k)!*Stirling2(n, 2k). - Ralf Stephan, May 23 2004
a(n) = D^n*(1/(1-x^2)) evaluated at x = 0, where D is the operator (1+x)*d/dx. Cf. A000670 and A005649. - Peter Bala, Nov 25 2011
E.g.f.: 1/(2*G(0)), where G(k) = 1 - 2^k/(2 - 4*x/(2*x - 2^k*(k+1)/G(k+1) )); (recursively defined continued fraction). - Sergei N. Gladkovskii, Dec 22 2012
a(n) ~ n!/(4*(log(2))^(n+1)). - Vaclav Kotesovec, Aug 10 2013
a(n) = (h(n)+(-1)^n)/2 where h(n) = Sum_{k=0..n} E(n,k)*2^k and E(n,k) the Eulerian numbers A173018 (see also A156365). - Peter Luschny, Sep 19 2015
a(n) = (-1)^n + Sum_{k=0..n-1} binomial(n,k) * a(k). - Ilya Gutkovskiy, Jun 11 2020

Extensions

Edited by N. J. A. Sloane, Sep 06 2013

A098557 Expansion of e.g.f. (1/2)*(1+x)*log((1+x)/(1-x)).

Original entry on oeis.org

0, 1, 2, 2, 8, 24, 144, 720, 5760, 40320, 403200, 3628800, 43545600, 479001600, 6706022400, 87178291200, 1394852659200, 20922789888000, 376610217984000, 6402373705728000, 128047474114560000, 2432902008176640000, 53523844179886080000, 1124000727777607680000
Offset: 0

Views

Author

Paul Barry, Sep 14 2004

Keywords

Crossrefs

From Johannes W. Meijer, Nov 12 2009: (Start)
Cf. A109613 (odd numbers repeated).
Equals the first left hand column of A167552.
Equals the first right hand column of A167556.
A098557(n)*A064455(n) equals the second right hand column of A167556(n).
(End)

Programs

  • Magma
    [0,1] cat [Factorial(n-1) + Factorial(n-2)*(1+(-1)^n)/2: n in [2..30]]; // G. C. Greubel, Jan 17 2018
  • Mathematica
    Join[{0,1}, Table[(n-1)! + (n-2)!*(1+(-1)^n)/2, {n,2,30}]] (* or *) With[{nmax = 50}, CoefficientList[Series[(1/2)*(1 + x)*Log[(1 + x)/(1 - x)], {x,0,nmax}], x]*Range[0,nmax]!] (* G. C. Greubel, Jan 17 2018 *)
  • PARI
    for(n=0, 30, print1(if(n==0,0, if(n==1, 1, (n-1)! + (n-2)!*(1 + (-1)^n)/2)), ", ")) \\ G. C. Greubel, Jan 17 2018
    

Formula

a(n+1) = n! + (n-1)! * (1-(-1)^n)/2.
a(n+2) = 2*A052558(n).
conjecture: -a(n) +a(n-1) +(n-1)*(n-3)*a(n-2)=0. - R. J. Mathar, Nov 14 2011
G.f.: 1-G(0), where G(k)= 1 + x*(2*k-1)/(1 - x*(2*k+2)/(x*(2*k+2) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 11 2013
Sum_{n>=1} 1/a(n) = sinh(1) + 1 = A073742 + 1. - Amiram Eldar, Jan 22 2023

A030077 Take n equally spaced points on circle, connect them by a path with n-1 line segments; sequence gives number of distinct path lengths.

Original entry on oeis.org

1, 1, 1, 3, 5, 17, 28, 105, 161, 670, 1001, 2869, 6188, 26565, 14502, 167898, 245157, 445507, 1562275, 6055315, 2571120, 44247137, 64512240, 65610820, 362592230, 1850988412, 591652989, 11453679146, 17620076360, 1511122441, 114955808528, 511647729284, 67876359922, 3347789809236, 1882352047787, 1404030562068, 32308782859535
Offset: 1

Views

Author

Daniel Lurie Gittelson, Dec 11 1999

Keywords

Comments

For n points on a circle, there are floor(n/2) distinct line segment lengths. Hence an upper bound for a(n) is the number of compositions of n-1 into floor(n/2) nonnegative parts, which is A099578(n-2). Conjecture: the upper bound is attained if n is prime. There are A052558(n-2) paths to be considered. - T. D. Noe, Jan 09 2007 [Edited by Petros Hadjicostas, Jul 19 2018]

Examples

			For n=4 the 3 lengths are: 3 boundary edges (length 3), edge-diagonal-edge (2 + sqrt(2)) and diagonal-edge-diagonal (1 + 2*sqrt(2)).
For n=5, the 4 edges of the path may include 0,...,4 diagonals, so a(5)=5.
		

Crossrefs

Cf. A007874 (similar, but with n line segments), A052558, A099578.
See A352568 for the multisets of line lengths.

Extensions

a(13) - a(16) from T. D. Noe, Jan 09 2007
Removed unnecessary mention of dihedral group from definition. - N. J. A. Sloane, Apr 02 2022
The terms a(1) to a(15) have been verified by Sean A. Irvine and a(1) to a(16) by Brendan McKay. - N. J. A. Sloane, Apr 02 2022
a(17) to a(37) from Brendan McKay, May 14 2022

A052591 Expansion of e.g.f. x/((1-x)(1-x^2)).

Original entry on oeis.org

0, 1, 2, 12, 48, 360, 2160, 20160, 161280, 1814400, 18144000, 239500800, 2874009600, 43589145600, 610248038400, 10461394944000, 167382319104000, 3201186852864000, 57621363351552000, 1216451004088320000, 24329020081766400000, 562000363888803840000
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

Stirling transform of 2*a(n) = [2,4,24,96,...] is A052841(n+1) = [2,6,38,270,...]. - Michael Somos, Mar 04 2004
a(n) is the number of even fixed points in all permutations of {1,2,...,n+1}. Example: a(2)=2 because we have 12'3, 132, 312, 213, 231, and 32'1, the even fixed points being marked. - Emeric Deutsch, Jul 18 2009

Crossrefs

Cf. A052558. - Emeric Deutsch, Jul 18 2009

Programs

  • Maple
    spec := [S,{S=Prod(Z,Sequence(Z),Sequence(Prod(Z,Z)))},labeled]: seq(combstruct[count](spec,size=n), n=0..20);
    G(x):=x/(1-x)/(1-x^2): f[0]:=G(x): for n from 1 to 19 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n],n=0..19); # Zerinvary Lajos, Apr 03 2009
  • PARI
    a(n)=if(n<0,0,n!*polcoeff(x/(1-x)/(1-x^2)+x*O(x^n),n))

Formula

Recurrence: {a(1)=1, a(0)=0, (-n^3 - 5*n^2 - 8*n - 4)*a(n) + (-2-n)*a(n+1) + (n+1)*a(n+2) = 0}.
a(n) = ((1/4)*(-1)^(1-n) + (1/2)*n + 1/4)*n!.
E.g.f.: x/((1-x)*(1-x^2)).
From Emeric Deutsch, Jul 18 2009: (Start)
a(n) = (n+1)!/2 if n is odd; a(n) = n!*n/2 if n is even.
a(n) = (n+1)! - A052558(n). (End)
a(n) = n!*A008619(n-1), n > 1. - R. J. Mathar, Nov 27 2011
Sum_{n>=1} 1/a(n) = 2*(CoshIntegral(1) + cosh(1) - gamma - 1) = 2*(A099284 + A073743 - A001620 - 1). - Amiram Eldar, Jan 22 2023

A152664 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} for which k is the maximal number of initial even entries (0 <= k <= floor(n/2)).

Original entry on oeis.org

1, 1, 1, 4, 2, 12, 8, 4, 72, 36, 12, 360, 216, 108, 36, 2880, 1440, 576, 144, 20160, 11520, 5760, 2304, 576, 201600, 100800, 43200, 14400, 2880, 1814400, 1008000, 504000, 216000, 72000, 14400, 21772800, 10886400, 4838400, 1814400, 518400, 86400
Offset: 1

Views

Author

Emeric Deutsch, Dec 13 2008

Keywords

Comments

Sum of entries in row n is n! (A000142).
Row n has 1 + floor(n/2) entries.
T(n,0) = A052558(n-1).
Sum_{k=0..ceiling(n/2)} k*T(n,k) = A152665(n).

Examples

			T(3,0)=4 because we have 123, 132, 312 and 321.
T(4,2)=4 because we have 2413, 2431, 4213 and 4231.
Triangle starts:
    1;
    1,   1;
    4,   2;
   12,   8,   4;
   72,  36,  12;
  360, 216, 108,  36;
		

Crossrefs

Programs

  • Maple
    T := proc (n, k) if `mod`(n, 2) = 1 then factorial((1/2)*n-1/2)*factorial((1/2)*n+1/2)*binomial(n-k-1, (1/2)*n-1/2) else factorial((1/2)*n)^2*binomial(n-k-1, (1/2)*n-1) end if end proc: for n to 11 do seq(T(n, k), k = 0 .. floor((1/2)*n)) end do; # yields sequence in triangular form

Formula

T(2n+1,k) = n!(n+1)!binomial(2*n-k,n);
T(2n,k) = (n!)^2*binomial(2n-k-1,n-1).

A007874 Distinct perimeter lengths of polygons with regularly spaced vertices.

Original entry on oeis.org

1, 1, 1, 2, 4, 10, 24, 63, 177, 428, 1230, 2556, 8202, 18506, 18162, 119069
Offset: 1

Views

Author

Peter H. Borcherds (p.h.borcherds(AT)bham.ac.uk)

Keywords

Comments

For n points on a circle there are floor(n/2) distinct line segment lengths. Hence an upper bound for a(n) is the number of compositions of n into floor(n/2) nonnegative parts, which is A127040(n-2). To find a(n), the length of A052558(n-2) paths must be computed. - T. D. Noe, Jan 13 2007 [edited by Petros Hadjicostas, Jul 19 2018]

Examples

			Consider n=4. Label the points on the circle A,B,C and D. Suppose that AB has unit length. Then a(4)=2 because the two 4-gons are ABCDA and ACBDA, with perimeters 4 and 2+2*sqrt(2), respectively.
		

Crossrefs

Cf. A030077.

Extensions

More terms from T. D. Noe, Jan 13 2007

A161133 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} having exactly k odd fixed points (0 <= k <= ceiling(n/2)).

Original entry on oeis.org

1, 0, 1, 1, 1, 3, 2, 1, 14, 8, 2, 64, 42, 12, 2, 426, 234, 54, 6, 2790, 1704, 468, 72, 6, 24024, 12864, 3024, 384, 24, 205056, 120120, 32160, 5040, 480, 24, 2170680, 1145400, 272400, 37200, 3000, 120, 22852200, 13024080, 3436200, 544800, 55800
Offset: 0

Views

Author

Emeric Deutsch, Jul 18 2009

Keywords

Comments

Row n contains 1 + ceiling(n/2) entries.
Sum of row n is n! = A000142(n).
T(n,0) = A161131(n).
Sum_{k>=0} k*T(n,k) = A052558(n-1).

Examples

			T(3,0)=3 because we have 312, 231, 321; T(3,2)=1 because we have 123.
Triangle starts:
    1;
    0,   1;
    1,   1;
    3,   2,  1;
   14,   8,  2;
   64,  42, 12, 2;
  426, 234, 54, 6;
		

Crossrefs

Programs

  • Maple
    T := proc (n, k) options operator, arrow: binomial(ceil((1/2)*n), k)*add((-1)^j*binomial(ceil((1/2)*n)-k, j)*factorial(n-k-j), j = 0 .. ceil((1/2)*n)-k) end proc: for n from 0 to 12 do seq(T(n, k), k = 0 .. ceil((1/2)*n)) end do; # yields sequence in triangular form
  • Mathematica
    Flatten[Table[Binomial[Ceiling[n/2], k]*Sum[(-1)^j*(n - k - j)!*Binomial[Ceiling[n/2] - k, j], {j, 0, Ceiling[n/2] - k}],{n, 0, 11}, {k, 0, Ceiling[n/2]}]] (* Indranil Ghosh, Mar 08 2017 *)
  • PARI
    tabf(nn) = { for(n=0, nn, for(k = 0, ceil(n/2), print1(binomial(ceil(n/2), k) * sum(j=0, ceil(n/2) - k, (-1)^j*(n - k - j)! * binomial(ceil(n/2) - k, j)),", ");); print();); };
    tabf(12); \\ Indranil Ghosh, Mar 08 2017

Formula

T(n,k) = binomial(ceiling(n/2), k)*Sum_{j=0..ceiling(n/2)-k} (-1)^j*(n-k-j)!*binomial(ceiling(n/2)-k, j).

A327882 a(n) = n*(2*(n-1))! for n > 0, a(0) = 1.

Original entry on oeis.org

1, 1, 4, 72, 2880, 201600, 21772800, 3353011200, 697426329600, 188305108992000, 64023737057280000, 26761922089943040000, 13488008733331292160000, 8065829222532112711680000, 5646080455772478898176000000, 4573325169175707907522560000000, 4244045756995056938180935680000000
Offset: 0

Views

Author

Bruno Zürcher, Sep 28 2019

Keywords

Comments

Even denominators of coefficients in Taylor series expansion of 2 - 2*cos(x) - 2*x*sin(x) + x^2.
Equivalent to the even denominators of expansion of (1-cos(x))^2 + (x-sin(x))^2, which is the square of the secant length measured from the origin (0,0) to the cycloid point (1-cos(x), x-sin(x)). Note that only x^4 has the first nonzero coefficient of the series.
Numerators of the Taylor series expansion are given by A327883.
The Taylor series itself has an expansion Sum_{k>=2} (-1)^k*2*(2*k-1)/(2*k)!*x^(2*k).

Examples

			2 + x^2 - 2*cos(x) - 2*x*sin(x) = (1/4)*x^4 - (1/72)*x^6 + (1/2880)*x^8 - (1/201600)*x^10 + (1/21772800)*x^12 - ...
		

Crossrefs

Programs

  • Mathematica
    Denominator[CoefficientList[ Series[2 - 2 Cos[x] - (2 x) Sin[x] + x^2, {x, 0, 33}], x][[ ;; ;; 2]]]
  • PARI
    a(n) = {if(n<1, n==0, (2*n)!/(2*(2*n-1)))} \\ Andrew Howroyd, Oct 09 2019

Formula

a(n) = (2*n)!/(2*(2*n-1)) = n*A010050(n-1) for n >= 1.
a(n) = A171005(2*n-1) for n >= 2. - Andrew Howroyd, Oct 09 2019
a(n) = (1/2)*(2*n)!*[x^(2*n)](1 + x*arctanh(x)) for n > 0. - Peter Luschny, Oct 09 2019
D-finite with recurrence a(n) -2*n*(2*n-3)*a(n-1)=0. - R. J. Mathar, Feb 01 2022

A136581 Triangle read by rows: A136572 * A128174.

Original entry on oeis.org

1, 0, 1, 2, 0, 2, 0, 6, 0, 6, 24, 0, 24, 0, 24, 0, 120, 0, 120, 0, 120, 720, 0, 720, 0, 720, 0, 720, 0, 5040, 0, 5040, 0, 5040, 0, 5040
Offset: 0

Views

Author

Gary W. Adamson, Jan 09 2008

Keywords

Comments

Row sums = A052558: (1, 1, 4, 12, 72, 360, ...).

Examples

			First few rows of the triangle:
   1;
   0,   1;
   2,   0,   2;
   0,   6,   0,   6;
  24,   0,  24,   0,  24;
   0, 120,   0, 120,   0, 120;
  ...
		

Crossrefs

Formula

A136572 * A128174 as infinite lower triangular matrices.
Showing 1-9 of 9 results.