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 25 results. Next

A000366 Genocchi numbers of second kind (A005439) divided by 2^(n-1).

Original entry on oeis.org

1, 1, 2, 7, 38, 295, 3098, 42271, 726734, 15366679, 391888514, 11860602415, 420258768950, 17233254330343, 809698074358250, 43212125903877439, 2599512037272630686, 175079893678534943287, 13122303354155987156306, 1088559958829010054171343, 99456043127935948731527942
Offset: 1

Views

Author

Keywords

Comments

The earliest known reference to these numbers is the Dellac Marseille memoir. - Don Knuth, Jul 11 2007
According to Ira Gessel, Dellac's interpretation is the following: start with a 2n X n array of cells and consider the set D of cells in rows i through i+n of column i, for i from 1 to n. Then a(n) is the number of subsets of D containing two cells in each column and one cell in each row.
Barsky proved that for even n>1, a(n) is congruent to 3 mod 4 and for odd n>1, congruent to 2 mod 4. Gessel shows that for even n>5, a(n) is congruent to 4n-1 mod 16 and for odd n>2 that a(n)/2 is congruent to 2-n mod 8.
The entry for A005439 has further information.
The number of sequences (I_1,...,I_{n-1}) consisting of subsets of the set {1,...,n} such that the number of elements in I_k is exactly k and I_k\subset I_{k+1}\cup {k+1}. The Euler characteristics of the degenerate flag varieties of type A. - Evgeny Feigin, Dec 15 2011
Kreweras proved that for n>2, a(n) is alternatively congruent to 2 and to 7 mod 36. - Michel Marcus, Nov 06 2012

Examples

			G.f. = x + x^2 + 2*x^3 + 7*x^4 + 38*x^5 + 295*x^6 + 3098*x^7 + ...
		

References

  • Anonymous, L'Intermédiaire des Mathématiciens, 7 (1900), p. 328.
  • Hippolyte Dellac, Problem 1735, L'Intermédiaire des Mathématiciens, Vol. 7 (1900), p. 9 ff.
  • E. Lemoine, L'Intermédiaire des Mathématiciens, 8 (1901), 168-169.
  • 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

First column, first diagonal and row sums of triangle A014784.
Also row sums of triangle A239894.

Programs

  • Mathematica
    a[n_] = (-2^(-1))^(n-2)* Sum[ Binomial[n, k]*(1 - 2^(n+k+1))*BernoulliB[n+k+1], {k, 0, n}]; Table[a[n], {n,19}] (* Jean-François Alcover, Jul 18 2011, after PARI prog. *)
  • PARI
    a(n)=(-1/2)^(n-2)*sum(k=0,n,binomial(n,k)*(1-2^(n+k+1))*bernfrac(n+k+1))
    
  • PARI
    {a(n)=local(CF=1+x*O(x^n));if(n<1,return(0), for(k=1,n,CF=1/(1-((n-k)\2+1)*((n-k)\2+2)/2*x*CF));return(Vec(CF)[n]))} (Hanna)
    
  • PARI
    {a(n)=polcoeff( x*sum(m=0, n, m!*(m+1)!*(x/2)^m / prod(k=1, m,1 + k*(k+1)*x/2 +x*O(x^n)) ), n)} \\ Paul D. Hanna, Feb 03 2013
    
  • Python
    from math import comb
    from sympy import bernoulli
    def A000366(n): return (-1 if n&1 else 1)*sum(comb(n,k)*(1-(1<>n-2 if n>1 else 1 # Chai Wah Wu, Apr 14 2023
  • Sage
    # Algorithm of L. Seidel (1877)
    # n -> [a(1), ..., a(n)] for n >= 1.
    def A000366_list(n) :
        D = [0]*(n+2); D[1] = 1
        R = []; z = 1/2; b = False
        for i in(0..2*n-1) :
            h = i//2 + 1
            if b :
                for k in range(h-1, 0, -1) : D[k] += D[k+1]
                z *= 2
            else :
                for k in range(1, h+1, 1) :  D[k] += D[k-1]
            b = not b
            if not b : R.append(D[1]/z)
        return R
    A000366_list(19) # Peter Luschny, Jun 29 2012
    

Formula

From Don Knuth, Jul 11 2007: (Start)
The anonymous 1900 note in Interm. Math. gives a formula that is equivalent to a nice generating function:
For example, the first four terms on the right are
1
... 2x - 2x^2 + 2x^3 + ...
........ 9x^2 - 36x^3 + ...
............... 72x^3 + ...
summing to 1 + 2x + 7x^2 + 38x^3 + ... . Of course one can replace x with 2x and get a generating function for A005439. (End)
(-2)^(2-n) * Sum_{k=0..n} C(n, k)*(1-2^(n+k+1))*B(n+k+1), with B(n) the Bernoulli numbers.
O.g.f.: A(x) = x/(1-x/(1-x/(1-3*x/(1-3*x/(1-6*x/(1-6*x/(... -[n/2+1]*[n/2+2]/2*x/(1- ...)))))))) (continued fraction). - Paul D. Hanna, Oct 07 2005
Sum_{n>0} a(n)x^n = Sum_{n>0} (n!^2/2^{n-1}) (x^n/((1+x)(1+3x)...(1+binomial(n,2)x))).
a(n+1) = Sum_{k=0..n} A211183(n,k). - Philippe Deléham, Feb 03 2013
G.f.: Q(0)*2 - 2, where Q(k) = 1 - x*(k+1)^2/( x*(k+1)^2 - 2/(1 - x*(k+1)^2/( x*(k+1)^2 - 2/Q(k+1) ))); (continued fraction). - Sergei N. Gladkovskii, Oct 22 2013
a(n) ~ 2^(n+5) * n^(2*n+3/2) / (exp(2*n) * Pi^(2*n+1/2)). - Vaclav Kotesovec, Oct 28 2014

Extensions

More terms from David W. Wilson, Jan 11 2001
Edited by Ralf Stephan, Apr 17 2004

A099960 An interleaving of the Genocchi numbers of the first and second kind, A110501 and A005439.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 8, 17, 56, 155, 608, 2073, 9440, 38227, 198272, 929569, 5410688, 28820619, 186043904, 1109652905, 7867739648, 51943281731, 401293838336, 2905151042481, 24290513745920, 191329672483963, 1721379917619200, 14655626154768697, 141174819474169856
Offset: 0

Views

Author

N. J. A. Sloane, Nov 13 2004

Keywords

Comments

First column (also row sums) of triangle in A099959.
Number of ascent sequences of length n without level steps and with alternating ascents and descents. a(6) = 8: 010101, 010102, 010103, 010201, 010202, 010203, 010212, 010213. - Alois P. Heinz, Oct 27 2017

References

  • Donald E. Knuth, The Art of Computer Programming, Vol. 4, fascicle 1, section 7.1.4, p. 220, answer to exercise 174, Addison-Wesley, 2009.

Crossrefs

Programs

  • Maple
    with(linalg):rev:=proc(a) local n, p; n:=vectdim(a): p:=i->a[n+1-i]: vector(n,p) end: ps:=proc(a) local n, q; n:=vectdim(a): q:=i->sum(a[j],j=1..i): vector(n,q) end: pss:=proc(a) local n, q; n:=vectdim(a): q:=proc(i) if i<=n then sum(a[j],j=1..i) else sum(a[j],j=1..n) fi end: vector(n+1,q) end: R[0]:=vector(1,1): for n from 1 to 30 do if n mod 2 = 1 then R[n]:=ps(rev(R[n-1])) else R[n]:=pss(rev(R[n-1])) fi od: seq(R[n][1],n=0..30); # Emeric Deutsch
  • Mathematica
    g1 = Table[2*(4^n-1)*BernoulliB[2*n] // Abs, {n, 0, 13}]; g2 = Table[2*(-1)^(n-2)*Sum[Binomial[n, k]*(1-2^(n+k+1))*BernoulliB[n+k+1], {k, 0, n}], {n, 0, 13}]; Riffle[g1, g2] // Rest (* Jean-François Alcover, May 23 2013 *)
  • Sage
    # Algorithm of L. Seidel (1877)
    def A099960_list(n) :
        D = [0]*(n//2+3); D[1] = 1
        R = []; b = True; h = 1
        for i in (1..n) :
            if b :
                for k in range(h,0,-1) : D[k] += D[k+1]
                R.append(D[1]); h += 1
            else :
                for k in range(1,h, 1) : D[k] += D[k-1]
                R.append(D[h-1])
            b = not b
        return R
    A099960_list(27)  # Peter Luschny, Apr 30 2012

Formula

a(n) ~ 2^(5/2) * n^(n+3/2) / (Pi^(n+1/2) * exp(n)). - Vaclav Kotesovec, Sep 10 2014

Extensions

More terms from Emeric Deutsch, Nov 16 2004

A362112 a(0)=1; thereafter a(n) = 2*A110501(n+1) - A005439(n).

Original entry on oeis.org

1, 1, 4, 26, 254, 3538, 67014, 1660866, 52230550, 2033261906, 96018823814, 5409008246626, 358368831222006, 27589872391918194, 2442595357421865574, 246430234111929035906, 28106918525950072081622, 3598669462582938225587602, 513978991104098010878849094
Offset: 0

Views

Author

N. J. A. Sloane, Apr 14 2023

Keywords

Crossrefs

Programs

  • Python
    from math import comb
    from sympy import bernoulli
    def A362112(n): return ((4<<(m:=n+1<<1))-4)*abs(bernoulli(m))-abs(sum(comb(n,k)*(2-(2<Chai Wah Wu, Apr 14 2023

Extensions

More terms from Chai Wah Wu, Apr 14 2023

A141449 A005439 mod 9.

Original entry on oeis.org

1, 1, 2, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8
Offset: 0

Views

Author

Paul Curtz, Aug 07 2008

Keywords

Extensions

Missing a(0)=1 inserted by Sean A. Irvine, Jun 18 2023

A110501 Unsigned Genocchi numbers (of first kind) of even index.

Original entry on oeis.org

1, 1, 3, 17, 155, 2073, 38227, 929569, 28820619, 1109652905, 51943281731, 2905151042481, 191329672483963, 14655626154768697, 1291885088448017715, 129848163681107301953, 14761446733784164001387, 1884515541728818675112649, 268463531464165471482681379
Offset: 1

Views

Author

Michael Somos, Jul 23 2005

Keywords

Comments

The Genocchi numbers satisfy Seidel's recurrence: for n > 1, 0 = Sum_{j=0..floor(n/2)} (-1)^j*binomial(n, 2*j)*a(n-j). - Ralf Stephan, Apr 17 2004
The (n+1)-st Genocchi number is the number of Dumont permutations of the first kind on 2n letters. In a Dumont permutation of the first kind, each even integer must be followed by a smaller integer and each odd integer is either followed by a larger integer or is the last element. - Ralf Stephan, Apr 26 2004
The (n+1)-st Genocchi number is also the number of ways to place n rooks (attacking along planes; also called super rooks of power 2 by Golomb and Posner) on the three-dimensional Genocchi boards of size n. The Genocchi board of size n consists of cells of the form (i, j, k) where min{i, j} <= k and 1 <= k <= n. A rook placement on this board can also be realized as a pair of permutations of n the smallest number in the i-th position of the two permutations is not larger than i. - Feryal Alayont, Nov 03 2012
The (n+1)-st Genocchi number is also the number of Dumont permutations of the second kind, third kind, and fourth kind on 2n letters. In a Dumont permutation of the second kind, all odd positions are weak excedances and all even positions are deficiencies. In a Dumont permutation of the third kind, all descents are from an even value to an even value. In a Dumont permutation of the fourth kind, all deficiencies are even values at even positions. - Alexander Burstein, Jun 21 2019
The (n+1)-st Genocchi number is also the number of semistandard Young tableaux of skew shape (n+1,n,...,1)/(n-1,n-2,...,1) such that the entries in row i are at most i for i=1,...,n+1. - Alejandro H. Morales, Jul 26 2020
The (n+1)-st Genocchi number is also the number of positive terms of the Okounkov-Olshanski formula for the number of standard tableaux of skew shape (n+1,n,n-1,...,1)/(n-1,n-2,...,1), given by the (2n+1)-st Euler number A000111. - Alejandro H. Morales, Jul 26 2020
The (n+1)-st Genocchi number is also the number of collapsed permutations in (2n-1) letters. A permutation pi of size 2n-1 is said to be collapsed if ceil(k/2) <= pi^{-1}(k) <= n + floor(k/2). There are 3 collapsed permutations of size 3, namely 123, 132 and 213. - Arvind Ayyer, Oct 23 2020

Examples

			E.g.f.: x*tan(x/2) = x^2/2! + x^4/4! + 3*x^6/6! + 17*x^8/8! + 155*x^10/10! + ...
O.g.f.: A(x) = x + x^2 + 3*x^3 + 17*x^4 + 155*x^5 + 2073*x^6 + ...
where A(x) = x + x^2/(1+x) + 2!^2*x^3/((1+x)*(1+4*x)) + 3!^2*x^4/((1+x)*(1+4*x)*(1+9*x)) + 4!^2*x^5/((1+x)*(1+4*x)*(1+9*x)*(1+16*x)) + ... . - _Paul D. Hanna_, Jul 21 2011
From _Gary W. Adamson_, Jul 19 2011: (Start)
The first few rows of production matrix M are:
  1, 2,  0,  0,  0, 0, ...
  1, 3,  3,  0,  0, 0, ...
  1, 4,  6,  4,  0, 0, ...
  1, 5, 10, 10,  5, 0, ...
  1, 6, 15, 20, 15, 6, ... (End)
		

References

  • L. Carlitz, A conjecture concerning Genocchi numbers. Norske Vid. Selsk. Skr. (Trondheim) 1971, no. 9, 4 pp. MR0297697 (45 #6749)
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 49.
  • Leonhard Euler, Institutionum Calculi Differentialis, volume 2 (1755), para. 181.
  • A. Genocchi, Intorno all'espressione generale de'numeri Bernulliani, Ann. Sci. Mat. Fis., 3 (1852), 395-405.
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2 (1999) p. 74; see Problem 5.8.

Crossrefs

Programs

  • Magma
    [Abs(2*(4^n-1)*Bernoulli(2*n)): n in [1..20]]; // Vincenzo Librandi, Jul 28 2017
    
  • Maple
    A110501 := proc(n)
        2*(-1)^n*(1-4^n)*bernoulli(2*n) ;
    end proc:
    seq(A110501(n),n=0..10) ; # R. J. Mathar, Aug 02 2013
  • Mathematica
    a[n_] := 2*(4^n - 1) * BernoulliB[2n] // Abs; Table[a[n], {n, 19}] (* Jean-François Alcover, May 23 2013 *)
  • PARI
    {a(n) = if( n<1, 0, 2 * (-1)^n * (1 - 4^n) * bernfrac( 2*n))};
    
  • PARI
    {a(n) = if( n<1, 0, (2*n)! * polcoeff( x * tan(x/2 + x * O(x^(2*n))), 2*n))};
    
  • PARI
    {a(n)=polcoeff(sum(m=0,n,m!^2*x^(m+1)/prod(k=1,m, 1+k^2*x+x*O(x^n))),n)} /* Paul D. Hanna, Jul 21 2011 */
    
  • PARI
    upto(n) = my(v1, v2, v3); v1 = vector(n, i, 0); v1[1] = 1; v2 = vector(n-1, i, ((i+1)^2)\4); v3 = v1; for(i=2, n, for(j=2, i-1, v1[j] += v2[i-j+1]*v1[j-1]); v1[i] = v1[i-1]; v3[i] = v1[i]); v3 \\ Mikhail Kurkov, Aug 28 2025
    
  • Python
    from sympy import bernoulli
    def A110501(n): return ((2<<(m:=n<<1))-2)*abs(bernoulli(m)) # Chai Wah Wu, Apr 14 2023
  • Sage
    # Algorithm of L. Seidel (1877)
    # n -> [a(1), ..., a(n)] for n >= 1.
    def A110501_list(n) :
        D = []; [D.append(0) for i in (0..n+2)]; D[1] = 1
        R = [] ; b = True
        for i in(0..2*n-1) :
            h = i//2 + 1
            if b :
                for k in range(h-1,0,-1) : D[k] += D[k+1]
            else :
                for k in range(1,h+1,1) :  D[k] += D[k-1]
            b = not b
            if b : R.append(D[h])
        return R
    A110501_list(19) # Peter Luschny, Apr 01 2012
    
  • Sage
    [2*(-1)^n*(1-4^n)*bernoulli(2*n) for n in (1..20)] # G. C. Greubel, Nov 28 2018
    

Formula

(-1)^n * a(n) = A036968(2*n) = A001469(n).
a(n) = 2*(-1)^n*(1-4^n)*B_{2*n} (B = A027641/A027642 are Bernoulli numbers).
A002105(n) = 2^(n-1)/n * a(n). - Don Knuth, Jan 16 2007
A000111(2*n-1) = a(n)*2^(2*n-2)/n. - Alejandro H. Morales, Jul 26 2020
E.g.f.: x * tan(x/2) = Sum_{k > 0} a(k) * x^(2*k) / (2*k)!.
E.g.f.: x * tan(x/2) = x^2 / (2 - x^2 / (6 - x^2 / (... 4*k+2 - x^2 / (...)))). - Michael Somos, Mar 13 2014
O.g.f.: Sum_{n >= 0} n!^2 * x^(n+1) / Product_{k = 1..n} (1 + k^2*x). - Paul D. Hanna, Jul 21 2011
a(n) = Sum_{k = 0..2*n} (-1)^(n-k+1)*Stirling2(2*n, k)*A059371(k). - Vladeta Jovovic, Feb 07 2004
O.g.f.: A(x) = x/(1-x/(1-2*x/(1-4*x/(1-6*x/(1-9*x/(1-12*x/(... -[(n+1)/2]*[(n+2)/2]*x/(1- ...)))))))) (continued fraction). - Paul D. Hanna, Jan 16 2006
a(n) = Pi^(-2*n)*integral(log(t/(1-t))^(2*n)-log(1-1/t)^(2*n) dt,t=0,1). - Gerry Martens, May 25 2011
a(n) = the upper left term of M^(n-1); M is an infinite square production matrix with M[i,j] = C(i+1,j-1), i.e., Pascal's triangle without the first two rows and right border, see the examples and Maple program. - Gary W. Adamson, Jul 19 2011
G.f.: 1/U(0) where U(k) = 1 + 2*(k^2)*x - x*((k+1)^2)*(x*(k^2)+1)/U(k+1); (continued fraction, Euler's 1st kind, 1-step). - Sergei N. Gladkovskii, Sep 15 2012
a(n+1) = Sum_{k=0..n} A211183(n, k)*2^(n-k). - Philippe Deléham, Feb 03 2013
G.f.: 1 + x/(G(0)-x) where G(k) = 2*x*(k+1)^2 + 1 - x*(k+2)^2*(x*k^2+2*x*k+x+1)/G(k+1); (continued fraction). - Sergei N. Gladkovskii, Feb 10 2013
G.f.: G(0) where G(k) = 1 + x*(2*k+1)^2/( 1 + x + 4*x*k + 4*x*k^2 - 4*x*(k+1)^2*(1 + x + 4*x*k + 4*x*k^2)/(4*x*(k+1)^2 + (1 + 4*x + 8*x*k + 4*x*k^2)/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Feb 11 2013
G.f.: R(0), where R(k) = 1 - x*(k+1)^2/( x*(k+1)^2 - 1/(1 - x*(k+1)*(k+2)/( x*(k+1)*(k+2) - 1/R(k+1) ))); (continued fraction). - Sergei N. Gladkovskii, Oct 27 2013
E.g.f. (offset 1): sqrt(x)*tan(sqrt(x)/2) = Q(0)*x/2, where Q(k) = 1 - x/(x - 4*(2*k+1)*(2*k+3)/Q(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Jan 06 2014
Pi^2/6 = 2*Sum_{k=1..N} (-1)^(k-1)/k^2 + (-1)^N/N^2(1 - 1/N + 1/N^3 - 3/N^5 + 17/N^7 - 155/N^9 +- ...), where the terms in the parenthesis are (-1)^n*a(n)/N^(2n-1). - M. F. Hasler, Mar 11 2015
a(n) = 2*n*|euler(2*n-1, 0)|. - Peter Luschny, Jun 09 2016
a(n) = 4^(1-n) * (4^n-1) * Pi^(-2*n) * (2*n)! * zeta(2*n). - Daniel Suteu, Oct 14 2016
a(n) ~ 8*Pi*(2^(2*n)-1)*(n/(Pi*exp(1)))^(2*n+1/2)*exp(1/2+(1/24)/n-(1/2880)/n^3+(1/40320)/n^5+...). [Given in A001469 by Peter Luschny, Jul 24 2013, copied May 14 2022.]
a(n) = A000182(n) * n / 4^(n-1) (Han and Liu, 2018). - Amiram Eldar, May 17 2024

Extensions

Edited by M. F. Hasler, Mar 22 2015

A036968 Genocchi numbers (of first kind): expansion of 2*x/(exp(x)+1).

Original entry on oeis.org

1, -1, 0, 1, 0, -3, 0, 17, 0, -155, 0, 2073, 0, -38227, 0, 929569, 0, -28820619, 0, 1109652905, 0, -51943281731, 0, 2905151042481, 0, -191329672483963, 0, 14655626154768697, 0, -1291885088448017715, 0, 129848163681107301953
Offset: 1

Views

Author

Keywords

Comments

The sign of a(1) depends on which convention one chooses: B(n) = B_n(1) or B(n) = B_n(0) where B(n) are the Bernoulli numbers and B_n(x) the Bernoulli polynomials (see the Wikipedia article on Bernoulli numbers). The definition given is in line with B(n) = B_n(0). The convention B(n) = B_n(1) corresponds to the e.g.f. -2*x/(1+exp(-x)). - Peter Luschny, Jun 28 2013
According to Hetyei [2017], "alternation acyclic tournaments in which at least one ascent begins at each vertex, except for the largest one, are counted by the Genocchi numbers of the first kind." - Danny Rorabaugh, Apr 25 2017
Named after the Italian mathematician Angelo Genocchi (1817-1889). - Amiram Eldar, Jun 06 2021
Conjecture: For any positive integer n, -a(n+1) is the permanent of the n X n matrix M with M(j, k) = floor((2*j - k)/n), (j,k=1..n). - Zhi-Wei Sun, Sep 07 2021
A corresponding conjecture can also be made for L. Seidel's 'Genocchi numbers of second kind' A005439. - Peter Luschny, Sep 08 2021

References

  • Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 49.
  • A. Fletcher, J. C. P. Miller, L. Rosenhead and L. J. Comrie, An Index of Mathematical Tables. Vols. 1 and 2, 2nd ed., Blackwell, Oxford and Addison-Wesley, Reading, MA, 1962, Vol. 1, p. 73.
  • Ronald L. Graham, Donald E. Knuth and Oren Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 528.
  • Richard P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 5.8.

Crossrefs

A001469 is the main entry for this sequence. A226158 is another version.
Cf. A005439 (Genocchi numbers of second kind).

Programs

  • Maple
    a := n -> n*euler(n-1,0); # Peter Luschny, Jul 13 2009
  • Mathematica
    a[n_] := n*EulerE[n - 1, 0]; Table[a[n], {n, 1, 32}] (* Jean-François Alcover, Dec 08 2011, after Peter Luschny *)
    Range[0, 31]! CoefficientList[ Series[ 2x/(1 + Exp[x]), {x, 0, 32}], x] (* Robert G. Wilson v, Oct 26 2012 *)
    Table[(-1)^n 2 n PolyLog[1 - n, -1], {n, 1, 32}] (* Peter Luschny, Aug 17 2021 *)
  • PARI
    {a(n) = if( n<0, 0, n! * polcoeff( 2*x / (1 + exp(x + x * O(x^n))), n))}; /* Michael Somos, Jul 23 2005 */
    
  • PARI
    /* From o.g.f. (Paul D. Hanna, Aug 03 2014): */
    {a(n)=local(A=1); A=x*sum(m=0, n, m!*(-x)^m/(1-m*x)/prod(k=1,m,1 - k*x +x*O(x^n))); polcoeff(A, n)}
    for(n=1, 32, print1(a(n), ", "))
    
  • Python
    from sympy import bernoulli
    def A036968(n): return (2-(2<Chai Wah Wu, Apr 14 2023
  • Sage
    # with a(1) = -1
    [z*zeta(1-z)*(2^(z+1)-2) for z in (1..32)]  # Peter Luschny, Jun 28 2013
    
  • Sage
    def A036968_list(len):
        e, f, R, C = 4, 1, [], [1]+[0]*(len-1)
        for n in (2..len-1):
            for k in range(n, 0, -1):
                C[k] = C[k-1] / (k+1)
            C[0] = -sum(C[k] for k in (1..n))
            R.append((2-e)*f*C[0])
            f *= n; e *= 2
        return R
    print(A036968_list(34)) # Peter Luschny, Feb 22 2016
    

Formula

E.g.f.: 2*x/(exp(x)+1).
a(n) = 2*(1-2^n)*B_n (B = Bernoulli numbers). - Benoit Cloitre, Oct 26 2003
2*x/(exp(x)+1) = x + Sum_{n>=1} x^(2*n)*G_{2*n}/(2*n)!.
a(n) = Sum_{k=0..n-1} binomial(n,k) 2^k*B(k). - Peter Luschny, Apr 30 2009
From Sergei N. Gladkovskii, Dec 12 2012 to Nov 23 2013: (Start) Continued fractions:
E.g.f.: 2*x/(exp(x)+1) = x - x^2/2*G(0) where G(k) = 1 - x^2/(x^2 + 4*(2*k+1)*(2*k+3)/G(k+1)).
E.g.f.: 2/(E(0)+1) where E(k) = 1 + x/(2*k+1 - x*(2*k+1)/(x + (2*k+2)/E(k+1))).
G.f.: 2 - 1/G(0) where G(k) = 1 - x*(k+1)/(1 + x*(k+1)/(1 - x*(k+1)/(1 + x*(k+1)/G(k+1)))).
E.g.f.: 2*x/(1 + exp(x)) = 2*x-2 - 2*T(0), where T(k) = 4*k-1 + x/(2 - x/( 4*k+1 + x/(2 - x/T(k+1)))).
G.f.: 2 - Q(0)/(1-x+x^2) where Q(k) = 1 - x^4*(k+1)^4/(x^4*(k+1)^4 - (1 - x + x^2 + 2*x^2*k*(k+1))*(1 - x + x^2 + 2*x^2*(k+1)*(k+2))/Q(k+1)). (End)
a(n) = n*zeta(1-n)*(2^(n+1)-2) for n > 1. - Peter Luschny, Jun 28 2013
O.g.f.: x*Sum_{n>=0} n! * (-x)^n / (1 - n*x) / Product_{k=1..n} (1 - k*x). - Paul D. Hanna, Aug 03 2014
Sum_{n>=1} 1/a(2*n) = A321595. - Amiram Eldar, May 07 2021
a(n) = (-1)^n*2*n*PolyLog(1 - n, -1). - Peter Luschny, Aug 17 2021

A009843 E.g.f. x/cos(x) (odd powers only).

Original entry on oeis.org

1, 3, 25, 427, 12465, 555731, 35135945, 2990414715, 329655706465, 45692713833379, 7777794952988025, 1595024111042171723, 387863354088927172625, 110350957750914345093747, 36315529600705266098580265, 13687860690719716241164167451, 5858139922124796551409938058945
Offset: 0

Views

Author

Keywords

Comments

Expanding x/cosh(x) gives alternated signed values at odd positions.
Related to the formulas sum(k>0,sin(kx)/k^(2n+1))=(-1)^(n+1)/2*x^(2n+1)/(2n+1)!*sum(i=0,2n,(2Pi/x)^i*B(i)*C(2n+1,i)) and if x=Pi/2 sum(k>0,(-1)^(k+1)/k^(2n+1))=(-1)^n*E(2n)*Pi^(2n+1)/2^(2n+2)/(2n)!. - Benoit Cloitre, May 01 2002

Examples

			x/cos(x) = x + 1/2*x^3 + 5/24*x^5 + 61/720*x^7 + 277/8064*x^9 + ...
		

Crossrefs

Programs

  • Maple
    seq((2*i+1)!*coeff(series(x/cos(x),x,32),x,2*i+1),i=0..13);
    A009843 := n -> (-1)^n*(2*n+1)*euler(2*n): # Peter Luschny
  • Mathematica
    c = CoefficientList[Series[1/MittagLefflerE[2,z^2],{z,0,40}],z]; Table[(-1)^n* Factorial[2*n+1]*c[[2*n+1]], {n,0,16}] (* Peter Luschny, Jul 03 2016 *)
  • PARI
    a(n)=(-1)^(n+1)*sum(i=0,2*n+1,binomial(2*n+1,i)*bernfrac(i)*4^i)
    
  • PARI
    a(n)=subst(bernpol(2*n+1),'x,1/4)*4^(2*n+1)*(-1)^(n+1) \\ Charles R Greathouse IV, Dec 10 2014
    
  • Python
    # The objective of this implementation is efficiency.
    # n -> [a(0), a(1), ..., a(n)] for n > 0.
    def A009843_list(n):
        S = [0 for i in range(n+1)]
        S[0] = 1
        for k in range(1, n+1):
            S[k] = k*S[k-1]
        for k in range(1, n+1):
            for j in range(k, n+1):
                S[j] = (j-k)*S[j-1]+(j-k+1)*S[j]
            S[k] = (2*k+1)*S[k]
        return S
    print(A009843_list(10)) # Peter Luschny, Aug 09 2011

Formula

a(n) = (2n+1)*A000364(n) = sum(i=0, 2n, B(i)*C(2n+1, i)*4^i)=(2n+1)*E(2n) where B(i) are the Bernoulli numbers, C(2n, i) the binomial numbers and E(2n) the Euler numbers. - Benoit Cloitre, May 01 2002
Recurrence: a(n) = -(-1)^n*Sum[i=0..n-1, (-1)^i*a(i)*C(2n+1, 2i+1) ]. - Ralf Stephan, Feb 24 2005
a(n) = 4^n |E_{2n}(1/2)+E_{2n}(1)| (2n+1) for n > 0; E_{n}(x) Euler polynomial. - Peter Luschny, Nov 25 2010
a(n) = (2*n+1)! * [x^(2*n+1)] x/cos(x).
From Sergei N. Gladkovskii, Nov 15 2011, Oct 19 2012, Nov 10 2012, Jan 14 2013, Apr 10 2013, Oct 13 2013, Dec 01 2013: (Start) Continued fractions:
E.g.f.: x / cos(x) = x+x^3/Q(0); Q(k) = 8k+2-x^2/(1+(2k+1)*(2k+2)/Q(k+1)).
E.g.f.: x + x^3/U(0) where U(k) = (2*k+1)*(2*k+2) - x^2 + x^2*(2*k+1)*(2*k+2)/U(k+1).
G.f.: 1/G(0) where G(k) = 1 - x*(8*k^2+8*k+3)-16*x^2*(k+1)^4/G(k+1).
E.g.f.: 2*x/(Q(0) + 1) where Q(k)= 1 - x/(2*k+1)/(2*k+2)/(1 - 1/(1 + 1/Q(k+1))).
Let A(x) = S_{n>=0}a(n)*x^n/(2*n+1)! then A(x) = 1 + Q(0)*x/(2-x) where Q(k) = 1 - x*(2*k+1)*(2*k+2)/(x*(2*k+1)*(2*k+2) + ((2*k+1)*(2*k+2) - x)*((2*k+3)*(2*k+4) - x)/Q(k+1)).
G.f.: T(0)/(1-3*x) where T(k) = 1 - 16*x^2*(k+1)^4/(16*x^2*(k+1)^4 - (1 - x*(8*k^2 +8*k+3)) *(1 - x*(8*k^2+24*k+19))/T(k+1)).
G.f.: 1/T(0) where T(k) = 1 + x - x*(2*k+2)^2/(1 - x*(2*k+2)^2/T(k+1)). (End)
a(n) = (-1)^n*2^(4*n+1)*(2*n+1)*(zeta(-2*n,1/4)-zeta(-2*n,3/4)). - Peter Luschny, Jul 22 2013
From Peter Bala, Mar 02 2015: (Start)
a(n) = (-1)^(n+1)*4^(2*n + 1)*B(2*n + 1,1/4), where B(n,x) denotes the n-th Bernoulli polynomial. Cf. A002111, A069852 and A069994.
Conjecturally, a(n) = the unsigned numerator of B(2*n+1,1/4).
G.f. for signed version of sequence: Sum_{n >= 0} { 1/(n + 1) * Sum_{k = 0..n} (-1)^k*binomial(n,k)/( (1 - (4*k + 1)*x)*(1 - (4*k + 3)*x) ) } = 1 - 3*x^2 + 25*x^4 - 427*x^6 + .... (End)
a(n) ~ (2*n+1)! * 2^(2*n+2)/Pi^(2*n+1). - Vaclav Kotesovec, Jul 04 2016
G.f.: 1/(1 + x - 4*x/(1 - 4*x/(1 + x - 16*x/(1 - 16*x/(1 + x - 36*x/(1 - 36*x/(1 + x - ...))))))). Cf. A005439. - Peter Bala, May 07 2017

Extensions

Extended and signs tested by Olivier Gérard, Mar 15 1997

A226158 a(n) = 2*n*(2^n - 1)*zeta(1-n) where in the case n=0 the limit is understood, zeta(s) the Riemann zeta function.

Original entry on oeis.org

0, -1, -1, 0, 1, 0, -3, 0, 17, 0, -155, 0, 2073, 0, -38227, 0, 929569, 0, -28820619, 0, 1109652905, 0, -51943281731, 0, 2905151042481, 0, -191329672483963, 0, 14655626154768697, 0, -1291885088448017715, 0, 129848163681107301953
Offset: 0

Views

Author

Peter Luschny, Jun 28 2013

Keywords

Comments

Also known as the Genocchi numbers, apart from a(0) and a(1) same as A036968.
Consider the difference table of a(n), which is a variant of Seidel's Genocchi table A014781:
0 -1 -1 0 1 0 -3 0 17
-1 0 1 1 -1 -3 3 17 -17
1 1 0 -2 -2 6 14 -34 -138
0 -1 -2 0 8 8 -48 -104 448
-1 -1 2 8 0 -56 -56 552 1160
0 3 6 -8 -56 0 608 608 -8832
3 3 -14 -48 56 608 0 -9440 -9440
0 -17 -34 104 552 -608 -9440 0 198272
-17 -17 138 448 -1160 -8832 9440 198272 0
a(n) is an autosequence: its inverse binomial transform is the sequence signed (see A181722). The first column (inverse binomial transform) is 0, followed by -A036968. - Paul Curtz, Jul 22 2013
a(n+1) = p(0) where p(x) is the unique degree-n polynomial such that p(k) = a(k) for k = 1, ..., n+1. - Michael Somos, Apr 23 2014

Examples

			G.f. = - x - x^2 + x^4 - 3*x^6 + 17*x^8 - 155*x^10 + 2073*x^12 - 38227*x^14 + ...
		

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Rationals(), 50); [0] cat Coefficients(R!(Laplace( -2*x/(1+Exp(-x)) ))); // G. C. Greubel, Apr 22 2023
  • Maple
    seq(n!*coeff(series(-2*x/(1+exp(-x)), x, 34), x, n), n=0..32);
    # Second program:
    A226158 := proc(n) local f; f := z -> Zeta(1-z)*2*z*(2^z-1);
    if n=0 then limit(f(z), z=0) else f(n) fi end: seq(A226158(n), n=0..32);
  • Mathematica
    a[0]=0; a[1]= -1; a[n_]:= n*EulerE[n-1, 0]; Table[a[n], {n,0,32}] (* Jean-François Alcover, Sep 12 2013 *)
    (* Programs from Michael Somos, Apr 23 2014 *)
    a[n_]:= If[n<1, 0, -n*EulerE[n-1, 1]];
    a[n_]:= If[n<0, 0, 2*(1-2^n)*BernoulliB[n,1]]; (* End *)
    Table[2*n*PolyLog[1-n, -1], {n,0,32}] (* Peter Luschny, Aug 17 2021 *)
  • PARI
    my(x='x+O('x^40)); concat([0], Vec(serlaplace(-2*x/(1+exp(-x))))) \\ G. C. Greubel, Jan 19 2018
    
  • Sage
    def A226158(n): return -2*n*zeta(1-n)*(1-2^n) if n != 0 else 0
    [A226158(n) for n in (0..32)]
    # Alternatively:
    def A226158_list(len):
        e, f, R, C = 4, 1, [0], [1]+[0]*(len-1)
        for n in (2..len-1):
            for k in range(n, 0, -1):
                C[k] = -C[k-1] / (k+1)
            C[0] = -sum(C[k] for k in (1..n))
            R.append((2-e)*f*C[0])
            f *= n; e *= 2
        return R
    print(A226158_list(34)) # Peter Luschny, Feb 22 2016
    

Formula

E.g.f.: -2*x/(1+exp(-x)).
a(2n) = -A000367(n)*A090648(n). - Paul Curtz, Jul 22 2013
E.g.f.: -2*x/(1+exp(-x))= -2 - 2*T(0), where T(k) = 4*k-1 + x/( 2 - x/( 4*k+1 + x/( 2 - x/T(k+1) ))); (continued fraction). - Sergei N. Gladkovskii, Nov 23 2013
G.f.: conjecture: -x/Q(0),where Q(k) = 1 - x*(k+1)/(1 + x*(k+1)/(1 - x*(k+1)/(1 + x*(k+1)/Q(k+1) ))); (continued fraction). - Sergei N. Gladkovskii, Nov 23 2013
a(n) = 2*(1 - 2^n)*Bernoulli(n, 1). - Peter Luschny, Apr 16 2014
a(n) = -n*Euler(n - 1, 1). - Michael Somos, Apr 23 2014
a(n) = 2^n*(Bernoulli(n, 1/2) - Bernoulli(n, 1)). - Peter Luschny, Jul 10 2020
a(n) = 2*n*PolyLog[1 - n, -1] - Peter Luschny, Aug 17 2021

A347600 Irregular table read by rows, T(n, k) is the rank of the k-th Seidel permutation of {1,...,n}, permutations sorted in lexicographical order.

Original entry on oeis.org

2, 11, 17, 187, 211, 307, 331, 451, 452, 571, 572, 6937, 7057, 7657, 7777, 8497, 8498, 9217, 9218, 11977, 12097, 12697, 12817, 13537, 13538, 14257, 14258, 17737, 17739, 17857, 17859, 18577, 18578, 18579, 18580, 19297, 19298, 19299, 19300, 22777, 22779, 22897
Offset: 1

Views

Author

Peter Luschny, Sep 08 2021

Keywords

Comments

Let M be the 2n X 2n matrix with M(j, k) = floor((2*j - k - 1) / 2*n). A Seidel permutation of order n is a permutation sigma of {1,...,2n} if Product_{k=1..2n} M(k, sigma(k)) does not vanish.
Let P(n) denote the number of Seidel permutations of order n. We conjecture that P(n) = A005439(n). This conjecture was inspired by the conjecture of Zhi-Wei Sun in A036968. The name 'Seidel permutations' follows a comment of Don Knuth: "The earliest known reference for these numbers (A005439) is Seidel ...."
The related sequence A347599 lists Genocchi permutations.

Examples

			Table starts:
[1] 2;
[2] 11, 17;
[3] 187, 211, 307, 331, 451, 452, 571, 572.
.
The 8 permutations corresponding to the ranks are for n = 3:
187 -> [246135]; 211 -> [256134]; 307 -> [346125]; 331 -> [356124];
451 -> [456123]; 452 -> [456132]; 571 -> [546123]; 572 -> [546132].
		

Crossrefs

Programs

  • Julia
    function SeidelPermutations(n)
        f(m) = m >= 2n ? 1 : m < 0 ? -1 : 0
        Mat(n) = [[f(2*j - k - 1) for k in 1:2n] for j in 1:2n]
        M = Mat(n); P = permutations(1:2n); R = Int64[]
        S, rank = 0, 1
        for p in P
            m = prod(M[k][p[k]] for k in 1:2n)
            if m != 0
                S += m
                push!(R, rank)
            end
            rank += 1
        end
        # println(n, " -> ", (-1)^n*S)
        return R
    end
    for n in 1:5 println(SeidelPermutations(n)) end

A230324 a(n) = A226158(n) - 2*A226158(n+1).

Original entry on oeis.org

2, 1, -1, -2, 1, 6, -3, -34, 17, 310, -155, -4146, 2073, 76454, -38227, -1859138, 929569, 57641238, -28820619, -2219305810, 1109652905, 103886563462, -51943281731, -5810302084962, 2905151042481, 382659344967926
Offset: 0

Views

Author

Paul Curtz, Oct 16 2013

Keywords

Comments

The array A(n,k) = A(n-1,k+1) - A(n-1,k) of the sequence in the first row and higher-order sequences in followup rows starts:
2, 1, -1, -2, 1, 6, -3, ...
-1, -2, -1, 3, 5, -9, -31, ...
-1, 1, 4, 2, -14, -22, 82, ...
2, 3, -2, -16, -8, 104, 160, ...
1, -5, -14, 8, 112, 56, -1160, ...
-6, -9, 22, 104, -56, -1216, -608, ...
-3, 31, 82, -160, -1160, 608, 18880, ...
etc.
a(n) is an autosequence: Its inverse binomial transform is the sequence (up to a sign), which means top row and left column in the difference array have the same absolute values.
The main diagonal is the double of the first upper diagonal: A(n,n) = 2*A(n,n+1).
A(n,n+1) = (-1)^n*A005439(n), which also appears as the first upper diagonal of the difference array of A226158(n).

Examples

			a(0) =  0 - 2 * (-1) =  2,
a(1) = -1 - 2 * (-1) =  1,
a(2) = -1 - 2 *   0  = -1,
a(3) =  0 - 2 *   1  = -2,
a(4) =  1 - 2 *   0  =  1,
a(5) =  0 - 2 * (-3) =  6.
		

Crossrefs

Cf. A050946.

Programs

  • Maple
    A226158 := proc(n)
        if n = 0 then
            0;
        else
            Zeta(1-n)*2*n*(2^n-1) ;
        end if;
    end proc:
    A230324 := proc(n)
        A226158(n)-2*A226158(n+1) ;
    end proc: # R. J. Mathar, Oct 28 2013
  • Mathematica
    a[0] = 2; a[1] = 1; a[n_] := n EulerE[n-1, 0] - 2 (n+1) EulerE[n, 0];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Jun 07 2017 *)

Formula

a(n)/2 + A164555(n)/A027642(n) = 2*A225825(n)/A141056(n).
Showing 1-10 of 25 results. Next