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

A000940 Number of n-gons with n vertices.

Original entry on oeis.org

1, 2, 4, 12, 39, 202, 1219, 9468, 83435, 836017, 9223092, 111255228, 1453132944, 20433309147, 307690667072, 4940118795869, 84241805734539, 1520564059349452, 28963120073957838, 580578894859915650, 12217399235411398127, 269291841184184374868, 6204484017822892034404
Offset: 3

Views

Author

Keywords

Comments

Number of inequivalent undirected Hamiltonian cycles in complete graph on n labeled nodes under action of dihedral group of order 2n acting on nodes.

Examples

			Label the vertices of a regular n-gon 1,2,...,n.
For n=3,4,5 representatives for the polygons counted here are:
  (1,2,3,1),
  (1,2,3,4,1), (1,2,4,3,1),
  (1,2,3,4,5,1), (1,2,3,5,4,1), (1,2,4,5,3,1), (1,3,5,2,4,1).
For n=6:
  (1,2,3,4,5,6,1), (1,2,3,4,6,5,1), (1,2,3,5,6,4,1),
  (1,2,3,6,5,4,1), (1,2,4,3,6,5,1), (1,2,4,6,3,5,1),
  (1,2,4,6,5,3,1), (1,2,5,3,6,4,1), (1,2,5,4,6,3,1),
  (1,2,5,6,3,4,1), (1,2,6,4,5,3,1), (1,3,5,2,6,4,1).
		

References

  • J. H. Kwak and J. Lee, Enumeration of graph coverings, surface branched coverings and related group theory, in Combinatorial and Computational Mathematics (Pohang, 2000), ed. S. Hong et al., World Scientific, Singapore 2001, pp. 97-161.
  • R. C. Read, Some Enumeration Problems in Graph Theory. Ph.D. Dissertation, Department of Mathematics, Univ. London, 1958.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000939, A007619. Bisections give A094156, A094157.
For permutation classes under various symmetries see A089066, A262480, A002619.

Programs

  • Maple
    with(numtheory);
    # for n odd:
    Sd:=proc(n) local t1,d; t1:=2^((n-1)/2)*n^2*((n-1)/2)!; for d from 1 to n do if n mod d = 0 then t1:=t1+phi(n/d)^2*d!*(n/d)^d; fi; od: t1/(4*n^2); end;
    # for n even:
    Se:=proc(n) local t1,d; t1:=2^(n/2)*n*(n+6)*(n/2)!/4; for d from 1 to n do if n mod d = 0 then t1:=t1+phi(n/d)^2*d!*(n/d)^d; fi; od: t1/(4*n^2); end;
    A000940:=n-> if n mod 2 = 0 then Se(n) else Sd(n); fi;
  • Mathematica
    a[n_] := (t1 = If[OddQ[n], 2^((n - 1)/2)*n^2*((n - 1)/2)!, 2^(n/2)*n*(n + 6)*(n/2)!/4]; For[ d = 1 , d <= n, d++, If[Mod[n, d] == 0, t1 = t1 + EulerPhi[n/d]^2*d!*(n/d)^d]]; t1/(4*n^2)); Table[a[n], {n, 3, 25}] (* Jean-François Alcover, Jun 19 2012, after Maple *)
  • PARI
    a(n)={if(n<3, 0, (2^(n\2-2)*(n\2)!*n*if(n%2, 4*n, n + 6) + sumdiv(n, d, eulerphi(n/d)^2*d!*(n/d)^d))/(4*n^2))} \\ Andrew Howroyd, Sep 09 2018
    
  • Python
    from sympy import factorial, divisors, totient
    def A000940(n): return 1 if n == 3 else ((sum(totient(m:=n//d)**2*factorial(d)*m**d for d in divisors(n,generator=True))+(1<<(k:=n>>1)-2)*n*(n<<2 if n&1 else (n+6))*factorial(k))>>2)//n//n # Chai Wah Wu, Nov 07 2022

Formula

For formula see Maple lines.
a(p) = ((((p-1)! + 1)/p) + p - 2 + (2^((p-1)/2)*((p-1)/2)!))/4 for prime p. See A007619. - Ian Mooney, Oct 05 2022
a(n) ~ sqrt(2*Pi)/4 * n^(n-3/2) / e^n. - Ludovic Schwob, Nov 03 2022

Extensions

More terms from Pab Ter (pabrlos(AT)yahoo.com), May 05 2004

A000657 Median Euler numbers (the middle numbers of Arnold's shuttle triangle).

Original entry on oeis.org

1, 1, 4, 46, 1024, 36976, 1965664, 144361456, 13997185024, 1731678144256, 266182076161024, 49763143319190016, 11118629668610842624, 2925890822304510631936, 895658946905031792553984, 315558279782214450517374976, 126780706777739389745128013824
Offset: 0

Views

Author

Keywords

Comments

Also central terms of the triangle in A008280. - Reinhard Zumkeller, Nov 01 2013
Conjecture: taking the sequence modulo an integer k gives an eventually purely periodic sequence with period dividing phi(k). For example, the sequence taken modulo 9 begins [1, 1, 4, 1, 7, 4, 1, 7, 4, 1, 7, ...] with an apparent period [4, 1, 7] of length 3 = phi(9)/2 beginning at a(2). - Peter Bala, May 08 2023

References

  • V. I. Arnold, Springer numbers and Morsification spaces. J. Algebraic Geom. 1 (1992), no. 2, 197-214.
  • L. Seidel, Über eine einfache Entstehungsweise der Bernoulli'schen Zahlen und einiger verwandten Reihen, Sitzungsberichte der mathematisch-physikalischen Classe der königlich bayerischen Akademie der Wissenschaften zu München, volume 7 (1877), 157-187.

Crossrefs

Cf. A084938, A002832. For a signed version see A099023.
Related polynomials in A098277.
A diagonal of A323834.
Cf. A005799.

Programs

  • Haskell
    a000657 n = a008280 (2 * n) n  -- Reinhard Zumkeller, Nov 01 2013
    
  • Maple
    Digits := 40: rr := array(1..40,1..40): rr[1,1] := 1: for i from 1 to 39 do rr[i+1,1] := subs(x=0,diff(1+tan(x),x$i)): od: for i from 2 to 40 do for j from 2 to i do rr[i,j] := rr[i,j-1]-(-1)^i*rr[i-1,j-1]: od: od: [seq(rr[2*i-1,i],i=1..20)];
    # Alternatively after Alois P. Heinz in A000111:
    b := proc(u, o) option remember;
    `if`(u + o = 0, 1, add(b(o - 1 + j, u - j), j = 1..u)) end:
    a := n -> b(n, n): seq(a(n), n = 0..15); # Peter Luschny, Oct 27 2017
  • Mathematica
    max = 20; rr[1, 1] = 1; For[i = 1, i <= 2*max - 1, i++, rr[i + 1, 1] = D[1 + Tan[x], {x, i}] /. x -> 0]; For[i = 2, i <= 2*max, i++, For[j = 2, j <= i, j++, rr[i, j] = rr[i, j - 1] - (-1)^i*rr[i - 1, j - 1]]]; Table[rr[2*i - 1, i], {i, 1, max}] (* Jean-François Alcover, Jul 10 2012, after Maple *)
    T[n_,0] := KroneckerDelta[n,0]; T[n_,k_] := T[n,k]=T[n,k-1]+T[n-1,n-k]; Table[T[2n,n], {n,0,16}] (* Oliver Seipel, Nov 24 2024, after Peter Luschny *)
  • Maxima
    a(n):=(-1)^(n)*sum(binomial(n,k)*euler(n+k),k,0,n); /* Vladimir Kruchinin, Apr 06 2015 */
  • Sage
    # Algorithm of L. Seidel (1877)
    def A000657_list(n) :
        R = []; A = {-1:0, 0:1}
        k = 0; e = 1
        for i in (0..n) :
            Am = 0; A[k + e] = 0; e = -e
            for j in (0..i) :
                Am += A[k]; A[k] = Am; k += e
            if e < 0 :
                R.append(A[0])
        return R
    A000657_list(30)  # Peter Luschny, Apr 02 2012
    

Formula

Row sums of triangle, read by rows, [0, 1, 4, 9, 16, 25, 36, 49, ...] DELTA [1, 2, 6, 5, 11, 8, 16, 11, 21, 14, ...] where DELTA is Deléham's operator defined in A084938.
G.f.: Sum_{n>=0} a(n)*x^n = 1/(1-1*1x/(1-1*3x/(1-2*5x/(1-2*7x/(1-3*9x/...))))). - Ralf Stephan, Sep 09 2004
G.f.: 1/G(0) where G(k) = 1 - x*(8*k^2+4*k+1) - x^2*(k+1)^2*(4*k+1)*(4*k+3)/G(k+1); (recursively defined continued fraction). - Sergei N. Gladkovskii, Feb 05 2013
G.f.: G(0)/(1-x), where G(k) = 1 - x^2*(k+1)^2*(4*k+1)*(4*k+3)/( x^2*(k+1)^2*(4*k+1)*(4*k+3) - (1 - x*(8*k^2+4*k+1))*(1 - x*(8*k^2+20*k+13))/G(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Feb 01 2014
a(n) = (-1)^(n)*Sum_{k=0..n} C(n,k)*Euler(n+k). - Vladimir Kruchinin, Apr 06 2015
a(n) ~ 2^(4*n+5/2) * n^(2*n+1/2) / (exp(2*n) * Pi^(2*n+1/2)). - Vaclav Kotesovec, Apr 06 2015
Conjectural e.g.f. as a continued fraction: 1/(1 - (1 - exp(-2*t))/(2 - (1 - exp(-4*t))/(1 - (1 - exp(-6*t))/(2 - (1 - exp(-8*t))/(1 - ... )))) = 1 + t + 4*t^2/2! + 46*t^3/3! + .... Cf. A005799. - Peter Bala, Dec 26 2019

Extensions

More terms from Barbara Haas Margolius (margolius(AT)math.csuohio.edu), Feb 12 2001
Corrected by Sean A. Irvine, Dec 22 2010

A163747 Expansion of e.g.f. 2*exp(x)*(1-exp(x))/(1+exp(2*x)).

Original entry on oeis.org

0, -1, -1, 2, 5, -16, -61, 272, 1385, -7936, -50521, 353792, 2702765, -22368256, -199360981, 1903757312, 19391512145, -209865342976, -2404879675441, 29088885112832, 370371188237525, -4951498053124096, -69348874393137901
Offset: 0

Views

Author

Roger L. Bagula, Aug 03 2009

Keywords

Comments

The real part of the exponential expansion of 2*((1+i)/(1+i*exp(z))-1) = (-1-i)*z + (-1/2+i/2)*z^2 + (1/3+i/3)*z^3 + (5/24-5i/24)*z^4 + (-2/15-2i/15)*z^5 + ... where i is the imaginary unit.
From Paul Curtz, Mar 12 2013: (Start)
a(n) is an autosequence of the first kind; a(n) and successive differences are:
0, -1, -1, 2, 5, -16, -61;
-1, 0, 3, 3, -21, -45, 333;
1, 3, 0, -24, -24, 378, 780;
2, -3, -24, 0, 402, 402, -11214;
-5, -21, 24, 402, 0, -11616, -11616;
-16, 45, 378, -402, -11616, 0, 514608;
61, 333, -780, -11214, 11616, 514608, 0;
The main diagonal is A000004. The inverse binomial transform is the signed sequence.
The first two upper diagonals are A002832 (median Euler numbers) signed.
Sum of the antidiagonals: 0, -2, 0, 10, 0, ... = 2*A122045(n+1) (End)

Crossrefs

Variant: A163982.
Minus the zeroth column of A323833.

Programs

  • Maple
    A163747 := proc(n) exp(t)*(1-exp(t))/(1+exp(2*t)) ; coeftayl(%,t=0,n) ; 2*%*n! ; end proc: # R. J. Mathar, Sep 11 2011
    seq((euler(n) - 2^n*(2*euler(n,1)+euler(n,3/2)))/2 + 1, n=0..30); # Robert Israel, May 24 2016
    egf := (2 - 2*I)/(exp(-x) + I); ser := series(egf, x, 24):
    seq(n!*Re(coeff(ser, x, n)), n = 0..22); # Peter Luschny, Aug 09 2021
  • Mathematica
    f[t_] = (1 + I)/(1 + I*Exp[t]) - 1;
    Table[Re[2*n!*SeriesCoefficient[Series[f[t], {t, 0, 30}], n]], {n, 0, 30}]
    max = 20; Clear[g]; g[max + 2] = 1; g[k_] := g[k] = 1 - x + (4*k+3)*(k+1)*x^2 /( 1 + (4*k+5)*(k+1)*x^2 / g[k+1]); gf = -x/g[0]; CoefficientList[Series[gf, {x, 0, max}], x] (* Vaclav Kotesovec, Jan 22 2015, after Sergei N. Gladkovskii *)
    Table[(EulerE[n] - 2^n (2 EulerE[n, 1] + EulerE[n, 3/2]))/2 + 1, {n, 0, 20}] (* Benedict W. J. Irwin, May 24 2016 *)

Formula

G.f.: -x/W(0), where W(k) = 1 - x + (4*k+3)*(k+1)*x^2 / (1 + (4*k+5)*(k+1)*x^2 / W(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Jan 22 2015
a(n) ~ n! * (cos(Pi*n/2) - sin(Pi*n/2)) * 2^(n+2) / Pi^(n+1). - Vaclav Kotesovec, Apr 23 2015
a(n) = (A122045(n) - 2^n(2*Euler(n,1) + Euler(n,3/2)))/2 + 1, where Euler(n,x) is the n-th Euler polynomial. - Benedict W. J. Irwin, May 24 2016
a(n) = 2*4^n*(HurwitzZeta(-n, 1/4) - HurwitzZeta(-n, 3/4)) + HurwitzZeta(-n, 1)*(4^(n+1) - 2^(n+1)). - Peter Luschny, Jul 21 2020
a(n) = 2^n*(Euler(n, 1/2) - Euler(n, 1)). - Peter Luschny, Mar 19 2021
a(n) = ((-2)^(n + 1)*(1 - 2^(n + 1))*Bernoulli(n + 1))/(n + 1) + Euler(n). - Peter Luschny, May 06 2021
a(n) = n!*Re([x^n]((2 - 2*i)/(i + exp(-x)))). - Peter Luschny, Aug 09 2021

A098277 Coefficients of polynomials D(n,x) related to median Euler numbers.

Original entry on oeis.org

1, 2, 2, 8, 20, 12, 48, 224, 344, 168, 384, 2880, 8096, 9872, 4272, 3840, 42240, 186816, 407936, 430688, 171168, 46080, 698880, 4451328, 15030528, 27944576, 26627648, 9915072, 645120, 12902400, 111605760, 535271424, 1519126272
Offset: 0

Views

Author

Ralf Stephan, Sep 07 2004

Keywords

Comments

2^n(x+1) divides D(n,x).

Examples

			D(0,x) = 1,
D(1,x) = 2*x + 2,
D(2,x) = 8*x^2 + 20*x + 12,
D(3,x) = 48*x^3 + 224*x^2 + 344*x + 168,
D(4,x) = 384*x^4 + 2880*x^3 + 8096*x^2 + 9872*x + 4272.
		

Crossrefs

D(n, 1/2) = A002832(n+1), D(n, -1/2) = A000657(n).
D(n, 0)/2^n = A098278(n), D(n, 1)/2^n = A098279(n).
Leading coefficients are A000165. Constant terms are in A098431.

Programs

  • Mathematica
    d[0, ] = 1; d[n, x_] := d[n, x] = (x+1)(x+2)d[n-1, x+2] - x(x+1)d[n-1, x];
    Table[CoefficientList[d[n, x], x] // Reverse, {n, 0, 8}] // Flatten (* Jean-François Alcover, Jul 27 2018 *)
  • PARI
    D(n,x)=if(n<1,1,(x+1)*(x+2)*D(n-1,x+2)-x*(x+1)*D(n-1,x))
    
  • PARI
    T(n,k)=local(A=sum(m=0,n,m!*(2*x)^m*prod(j=1,m,(j+y)/(1+j*(j+1)*x +x*O(x^n)))));polcoeff(polcoeff(A,n,x),n-k,y)
    {for(n=0,8,for(k=0,n,print1(T(n,k),", "));print())} \\ Paul D. Hanna, Sep 05 2012

Formula

Recurrence: D(0, x)=1, D(n, x) = (x+1)(x+2)D(n-1, x+2) - x(x+1)D(n-1, x).
G.f.: Sum[n>=0, D(n, x)t^n] = 1/(1-2(x+1)t/(1-2(x+2)t/(1-4(x+3)t/(1-4(x+4)t/...)))).
G.f.: Sum_{n>=0} D(n,y)*x^n = Sum_{n>=0} n!*(2*x)^n*Product_{k=1..n} (k+y)/(1+k*(k+1)*x). - Paul D. Hanna, Sep 05 2012

A323833 A Seidel matrix A(n,k) read by antidiagonals upwards.

Original entry on oeis.org

0, 1, 1, 1, 0, -1, -2, -3, -3, -2, -5, -3, 0, 3, 5, 16, 21, 24, 24, 21, 16, 61, 45, 24, 0, -24, -45, -61, -272, -333, -378, -402, -402, -378, -333, -272, -1385, -1113, -780, -402, 0, 402, 780, 1113, 1385, 7936, 9321, 10434, 11214, 11616, 11616, 11214, 10434, 9321, 7936
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2019

Keywords

Comments

The first row is a signed version of the Euler numbers A000111.
Other rows are defined by A(n+1,k) = A(n,k) + A(n,k+1).

Examples

			Triangular array T(n,k) = A(n-k,k) (n >= 0, k = 0..n), read from the antidiagonals upwards of square array A:
     0;
     1,    1;
     1,    0,   -1;
    -2,   -3,   -3,   -2;
    -5,   -3,    0,    3,    5;
    16,   21,   24,   24,   21,   16;
    61,   45,   24,    0,  -24,  -45,  -61;
  -272, -333, -378, -402, -402, -378, -333, -272;
  ...
From _Petros Hadjicostas_, Mar 04 2021: (Start)
Square array A(n,k) (n, k >= 0) begins:
   0,  1,   -1,   -2,     5,    16,     -61,    -272,     1385, ...
   1,  0,   -3,    3,    21,   -45,    -333,    1113,     9321, ...
   1, -3,    0,   24,   -24,  -378,     780,   10434,   -33264, ...
  -2, -3,   24,    0,  -402,   402,   11214,  -22830,  -480162, ...
  -5, 21,   24, -402,     0, 11616,  -11616, -502992,  1017600, ...
  16, 45, -378, -402, 11616,     0, -514608,  514608, 31880016, ...
  ... (End)
		

Crossrefs

Cf. A000111, A002832 (next-to-main diagonal), A163747, A323834.

Programs

  • Maple
    A323833 := proc(n,k)
        option remember;
        local i ;
        if k =0 then
            -A163747(n) ;
        elif n =0 then
            (-1)^k*A163747(k) ;
        elif k =n then
            0 ;
        else
            add(binomial(n,i)*procname(0,k+i), i=0..n) ;
        end if;
    end proc:
    seq(seq(A323833(d-k,k),k=0..d),d=0..12) ; # R. J. Mathar, Jun 11 2025
  • PARI
    {b(n) = local(v=[1], t); if( n<0, 0, for(k=2, n+2, t=0; v = vector(k, i, if( i>1, t+= v[k+1-i]))); v[2])}; \\ Michael Somos's PARI program for A000111.
    c(n) = if(n==0, 0, (-1)^floor(n/2)*b(n))
    A(n, k) = sum(i=0, n, binomial(n, i)*c(k+i)) \\ Petros Hadjicostas, Mar 04 2021

Formula

From Petros Hadjicostas, Mar 04 2021: (Start)
Formulas about the square array A(n,k) (n,k > 0):
A(n,0) = -A163747(n) = (-1)^(n+1)*A(0,n) = if(n==0, 0, (-1)^floor(n/2)*A000111(n)).
A(n,n) = 0 and A(n,k) + (-1)^(n+k)*A(k,n) = 0.
A(n, k) = Sum_{i=0..n} binomial(n, i)*A(0,k+i).
Joint e.g.f.: Sum_{n,k >= 0} A(n,k)*(x^n/n!)*(y^k/k!) = 2*exp(-y)*(1 - exp(-x - y)) / (1 + exp(-2*(x + y))) = 2*exp(x)*(exp(x+y) - 1) / (exp(2*(x+y)) + 1).
Formulas about the triangular array T(n,k) = A(n-k,k) (0 <= k <= n):
T(n+1,k+1) = T(n+1,k) - T(n,k).
T(n,k) = -(-1)^n*T(n,n-k).
T(n,k) = Sum_{i=0..n-k} binomial(n-k,i)*T(k+i,k+i) for k=0..n with initial condition T(n,n) = (-1)^n*A163747(n). (End)

Extensions

More terms from Alois P. Heinz, Feb 09 2019

A004577 Erroneous version of A000940.

Original entry on oeis.org

1, 2, 4, 7, 39, 202, 1219, 9468, 83435, 80017
Offset: 3

Views

Author

N. J. A. Sloane, Sep 09 2014

Keywords

References

  • R. C. Read, Some Enumeration Problems in Graph Theory. Ph.D. Dissertation, Department of Mathematics, Univ. London, 1958.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
Showing 1-6 of 6 results.