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

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).

A239977 a(n) = -Sum_{k=0..n} binomial(n, k)*A226158(k).

Original entry on oeis.org

0, 1, 3, 6, 9, 10, 9, 14, 33, 18, -135, 22, 2097, 26, -38199, 30, 929601, 34, -28820583, 38, 1109652945, 42, -51943281687, 46, 2905151042529, 50, -191329672483911, 54, 14655626154768753, 58, -1291885088448017655, 62, 129848163681107302017, 66
Offset: 0

Views

Author

Paul Curtz, Mar 30 2014

Keywords

Comments

Let T(n, k) denote the difference table of a(n).
(-1)^(k+1)*T(3, 3+k) = T(k+3, 3) for k >= 0.
Without the first two rows and the first two columns we have the core of the Genocchi numbers, like A240581(n)/A239315(n) for the Bernoulli numbers. See A226158(n).
0, 1, 3, 6, 9, 10, ...
1, 2, 3, 3, 1, -1, ...
1, 1, 0, -2, -2, 6, ...
0, -1, -2, 0, 8, 8, ...
-1, -1, 2, 8, 0, -56, ...
0, 3, 6, -8, -56, 0, ...
The definition reflects the identity 2*((1-2^n)*B(n,1) + n) =
2*Sum_{k=0..n} C(n,k)*(2^k-1)*B(k,1) where B(n,x) denotes the Bernoulli polynomials. - Peter Luschny, Apr 16 2014

Crossrefs

Cf. A083007.

Programs

  • Magma
    [0,1] cat [2*((1 - 2^n)*Bernoulli(n) + n): n in [2..40]]; // Vincenzo Librandi, Mar 03 2015
  • Maple
    A239977 := n -> 2*((1-2^n)*bernoulli(n,1) + n):
    seq(A239977(n), n=0..33); # Peter Luschny, Mar 08 2015
  • Mathematica
    a[n_] := (EulerE[n-1, 0]+2)*n; a[0] = 0; a[1] = 1; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Apr 02 2014 *)

Formula

a(n) = 2*n + A226158(n).
a(2n) is divisible by 3.
a(2n+1) = A133653(n).
a(n) = 2*((1 - 2^n)*B(n, 1) + n), B(n, x) the Bernoulli polynomial. - Peter Luschny, Apr 16 2014
From Peter Bala, Mar 02 2015: (Start)
a(n) = (-2)^n * ( B(n,-1/2) - B(n,0) ), where B(n,x) denotes the n-th Bernoulli polynomial. More generally, for any nonzero integer k, k^n*( B(n,1/k) - B(n,0) ) is an integer for n >= 0. Cf. A083007.
a(0) = 0 and for n >= 1, a(n) = 1 - 1/(n + 1)*Sum_{k = 1..n-1} (-2)^(n-k)*binomial(n+1,k)*a(k).
E.g.f.: 2*x*exp(2*x)/(1 + exp(x)) = x + 3*x^2/2! + 6*x^3/3! + .... (End)
a(n) = Sum_{k=0..n-1} 2^k*binomial(n, k)*Bernoulli(k, 1). - Peter Luschny, Aug 17 2021

A229054 Autosequence preceding -A226158(n).

Original entry on oeis.org

0, 0, 0, 1, 2, 2, 1, 1, 4, 4, -13, -13, 142, 142, -1931, -1931, 36296, 36296, -893273, -893273, 27927346, 27927346, -1081725559, -1081725559, 50861556172, 50861556172, -2854289486309, -2854289486309
Offset: 0

Views

Author

Paul Curtz, Sep 12 2013

Keywords

Comments

Extension of the difference table of Genocchi numbers A226158(n). The signs are changed.
Consider the difference table of -A226158:
0, 1, 1, 0 -1, 0,
1, 0, -1, -1, 1, 3,
-1, -1, 0, 2, 2, -6,
0, 1, 2, 0, -8, -8,
1, 1, -2, -8, 0, 56,
0, -3, -6, 8, 56, 0, etc.
Upon the table, we prolonged the main diagonal by 0 followed by 0 on the same row. Hence
0, 0, 0, 1, 2, 2, 1, 1,
0, 0, 1, 1, 0, -1, 0, 3, = 0 followed by -A226158.
0, 1, 0, -1, -1, 1, 3, -3,
1, -1, -1, 0, 2, 2, -6, -14,
-2, 0, 1, 2, 0, -8, -8, 48,
2, 1, 1, -2, -8, 0, 56, 56,
-1, 0, -3, -6, 8, 56, 0, -608,
1, -3, -3, 14, 48, -56, -608, 0, etc.
The first row, a(n), is equal to its inverse binomial transform signed, the main diagonal of the difference table is composed of 0's, so it is an autosequence of the first kind.

Programs

  • Mathematica
    max = 24; p[0, ] = 1; p[n, x_] := (1+x)*((1+x)^(n-1) + x^(n-1))/2; t = Table[Coefficient[p[n, x], x, k], {n, 0, max+2}, {k, 0, max+2}]; a[n_] := Inverse[t][[All, 3]][[n+3]]; A133135 = Table[a[n], {n, 0, max}]; Join[{0, 0, 0}, Table[(-1)^n*A133135[[n+1]], {n, 0, max}]]
    (* or *)
    g[n_ /; n < 3] = 0; g[3] = -1; g[n_] := (n-2)*EulerE[n-3, 0]; Table[-g[n], {n, 0, 27}] // Accumulate (* Jean-François Alcover, Sep 12 2013 *)

Formula

a(n) = 0, 0, 0 followed by (-1)^n * A133135(n).

A243868 0 followed by -(n+1)*A226158(n).

Original entry on oeis.org

0, 0, 2, 3, 0, -5, 0, 21, 0, -153, 0, 1705, 0, -26949, 0, 573405, 0, -15802673, 0, 547591761, 0, -23302711005, 0, 1194695479813, 0, -72628776062025, 0, 5165901157067001, 0, -425013158488292213, 0
Offset: 0

Views

Author

Paul Curtz, Jun 13 2014

Keywords

Comments

An autosequence is a sequence which has its inverse binomial transform equal to the signed sequence. If the main diagonal is A000004=0's it is of the first kind. It is of the second kind if the main diagonal is the upper diagonal multiplied by 2.
Starting from the autosequence of second kind A198631(n)/A006519(n+1),the fractional Euler numbers,we build a family of alternated sequences of second and first kind. A row is 0 followed by n+1 times the preceding one.
1, 1/2, 0, -1/4, 0, 1/2, 0, -17/8, 0, 31/2,...
0, 1, 1, 0, -1, 0, 3, 0, -17, 0, 155,... = -A226158(n)
0, 0, 2, 3, 0, -5, 0, 21, 0, -153, 0, 1705,... = a(n).
a(n) is an autosequence of the second kind. Its difference table is:
0, 0, 2, 3, 0, -5, 0, 21, 0, -153,...
0, 2, 1, -3, -5, 5, 21, -21,...
2, -1, -4, -2, 10, 16, -42,...
-3, -3, 2, 12, 6, -58,..
0, 5, 10, -6, -64,...
5, 5, -16, -58,...
0, -21, -42,...
-21, -21,...
0,... .
a(n) is a post Genocchi sequence.

Examples

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

Crossrefs

Programs

  • Mathematica
    a[0] = a[1] = 0; a[2] = 2; a[n_] := -n*(n-1)*EulerE[n-2, 0]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Jun 17 2014 *)

Formula

The fourth column of the second triangle of A133135(n) (see also A140218) is
1, -5/2, 5/2, 0, 0, -21/2, 21/2,... = b(n).
c(n) = 0, 0, 0, 0, followed by 2*(-1)^n*b(n) = 0, 0, 0, 0, 2, 5, 5, 0, 0, 21, 21, -132, -132,... . Autosequence.
a(n) = c(n+2) -c(n+1).

Extensions

More terms from Jean-François Alcover, Jun 17 2014

A245683 Array T(n,k) read by antidiagonals, where T(0,k) = -A226158(k) and T(n+1,k) = 2*T(n,k+1) - T(n,k).

Original entry on oeis.org

0, 2, 1, 0, 1, 1, -6, -3, -1, 0, 0, -3, -3, -2, -1, 50, 25, 11, 4, 1, 0, 0, 25, 25, 18, 11, 6, 3, -854, -427, -201, -88, -35, -12, -3, 0, 0, -427, -427, -314, -201, -118, -65, -34, -17, 24930, 12465, 6019, 2796, 1241, 520, 201, 68, 17, 0
Offset: 0

Views

Author

Paul Curtz, Jul 29 2014

Keywords

Comments

Take T(n,k) = -A226158(k) and its transform via T(n+1,k) = 2*T(n,k+1) - T(n,k):
0, 1, 1, 0, -1, 0, 3, 0, -17, ...
2, 1, -1, -2, 1, 6, -3, -34, ... = A230324
0, -3, -3, 4, 11, -12, -65, ...
-6, -3, 11, 18, -35, -118, ...
0, 25, 25, -88, -201, ...
50, 25, -201, -314, ...
0, -427, -427, ...
-854, -427, ...
0, ...
Every row is alternatively an autosequence of the first kind, see A226158, and of the second kind, see A190339.
The second column is twice 1, -3, 25, -427, 12465, ... = (-1)^n*A009843(n) which is in the third column. See A132049(n), numerators of Euler's formula for Pi from the Bernoulli numbers, A243963 and A245244. Hence a link between the Genocchi numbers and Pi.
a(n) is the triangle of the increasing antidiagonals.

Examples

			Triangle a(n):
   0,
   2,  1,
   0,  1,  1,
  -6, -3, -1,  0,
   0, -3, -3, -2, -1,
  50, 25, 11,  4,  1,  0,
  etc.
		

Crossrefs

Programs

  • Mathematica
    t[0, 0] = 0; t[0, 1] = 1; t[0, k_] := -k*EulerE[k-1, 0]; t[n_, k_] := t[n, k] = -t[n-1, k] + 2*t[n-1, k+1]; Table[t[n-k, k], {n, 0, 9}, {k, 0, n}] // Flatten (* Jean-François Alcover, Aug 04 2014 *)

A279172 The autosequence of the first kind between A226158(n) and A278331(n).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Peter Luschny introduced the extended Genocchi numbers A226158(n), an autosequence of the first kind. They are linked to the second Bernoulli numbers B+(n) = A164555(n)/A027642(n). Here + is an exponent.
This yields the possible Genocchi twin numbers: -1, -1 followed by a(n).

Crossrefs

Programs

  • Mathematica
    a[n_] := (n+2)*EulerE[n+1, 0] - (n+1)*EulerE[n, 0]; a[0] = 0; Table[a[n], {n, 0, 30}] (* or: *)
    Join[{0}, Array[#*EulerE[#-1, 0]&, 32] // Differences // Rest]

Formula

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

A001469 Genocchi numbers (of first kind); unsigned coefficients give expansion of x*tan(x/2).

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

Keywords

Comments

The Genocchi numbers satisfy Seidel's recurrence: for n>1, 0 = Sum_{j=0..[n/2]} C(n,2j)*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
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

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 49.
  • L. Euler, Institutionum Calculi Differentialis, volume 2 (1755), para. 181.
  • 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.
  • A. Genocchi, Intorno all'espressione generale de'numeri Bernulliani, Ann. Sci. Mat. Fis., 3 (1852), 395-405.
  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 528.
  • 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).
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 5.8.

Crossrefs

a(n) = -A065547(n, 1) and A065547(n+1, 2) for n >= 1.

Programs

  • Magma
    [2*(1 - 4^n) * Bernoulli(2*n): n in [1..25]]; // Vincenzo Librandi, Oct 15 2018
    
  • Maple
    A001469 := proc(n::integer) (2*n)!*coeftayl( 2*x/(exp(x)+1), x=0,2*n) end proc:
    for n from 1 to 20 do print(A001469(n)) od : # R. J. Mathar, Jun 22 2006
  • Mathematica
    a[n_] := 2*(1-4^n)*BernoulliB[2n]; Table[a[n], {n, 17}] (* Jean-François Alcover, Nov 24 2011 *)
    a[n_] := 2*n*EulerE[2*n-1, 0]; Table[a[n], {n, 17}] (* Jean-François Alcover, Jul 02 2013 *)
    Table[4 n PolyLog[1 - 2 n, -1], {n, 1, 19}] (* Peter Luschny, Aug 17 2021 *)
  • PARI
    a(n)=if(n<1,0,n*=2; 2*(1-2^n)*bernfrac(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 */
    
  • Python
    from sympy import bernoulli
    def A001469(n): return (2-(2<<(m:=n<<1)))*bernoulli(m) # Chai Wah Wu, Apr 14 2023
  • Sage
    # Algorithm of L. Seidel (1877)
    # n -> [a(1), ..., a(n)] for n >= 1.
    def A001469_list(n) :
        D = [0]*(n+2); D[1] = -1
        R = []; 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]
            else :
                for k in range(1, h+1, 1) :  D[k] -= D[k-1]
            b = not b
            if not b : R.append(D[h])
        return R
    A001469_list(17) # Peter Luschny, Jun 29 2012
    

Formula

a(n) = 2*(1-4^n)*B_{2n} (B = Bernoulli numbers).
x*tan(x/2) = Sum_{n>=1} x^(2*n)*abs(a(n))/(2*n)! = x^2/2 + x^4/24 + x^6/240 + 17*x^8/40320 + 31*x^10/725760 + O(x^11).
E.g.f.: 2*x/(1 + exp(x)) = x + Sum_{n>=1} a(2*n)*x^(2*n)/(2*n)! = -x^2/2! + x^4/4! - 3 x^6/6! + 17 x^8/8! + ...
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..2n-1} 2^k*B(k)*binomial(2*n,k) where B(k) is the k-th Bernoulli number. - Benoit Cloitre, May 31 2003
abs(a(n)) = Sum_{k=0..2n} (-1)^(n-k+1)*Stirling2(2n, k)*A059371(k). - Vladeta Jovovic, Feb 07 2004
G.f.: -x/(1+x/(1+2x/(1+4x/(1+6x/(1+9x/(1+12x/(1+16x/(1+20x/(1+25x/(1+...(continued fraction). - Philippe Deléham, Nov 22 2011
E.g.f.: E(x) = 2*x/(exp(x)+1) = x*(1-(x^3+2*x^2)/(2*G(0)-x^3-2*x^2)); G(k) = 8*k^3 + (12+4*x)*k^2 + (4+6*x+2*x^2)*k + x^3 + 2*x^2 + 2*x - 2*(x^2)*(k+1)*(2*k+1)*(x+2*k)*(x+2*k+4)/G(k+1); (continued fraction, Euler's kind, 1-step). - Sergei N. Gladkovskii, Jan 18 2012
a(n) = (-1)^n*(2*n)!*Pi^(-2*n)*4*(1-4^(-n))*Li{2*n}(1). - Peter Luschny, Jun 29 2012
Asymptotic: abs(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+...). - Peter Luschny, Jul 24 2013
G.f.: x/(T(0)-x) -1, where T(k) = 2*x*k^2 + 4*x*k + 2*x - 1 - x*(-1+x+2*x*k+x*k^2)*(k+2)^2/T(k+1); (continued fraction). - Sergei N. Gladkovskii, Nov 17 2013
G.f.: -1 + x/(T(0)+x), where T(k) = 1 + (k+1)*(k+2)*x/(1+x*(k+2)^2/T(k+1)); (continued fraction). - Sergei N. Gladkovskii, Nov 17 2013
a(n) = 4*n*PolyLog(1 - 2*n, -1). - Peter Luschny, Aug 17 2021

A003149 a(n) = Sum_{k=0..n} k!*(n - k)!.

Original entry on oeis.org

1, 2, 5, 16, 64, 312, 1812, 12288, 95616, 840960, 8254080, 89441280, 1060369920, 13649610240, 189550368000, 2824077312000, 44927447040000, 760034451456000, 13622700994560000, 257872110354432000, 5140559166898176000, 107637093007589376000, 2361827297364885504000
Offset: 0

Views

Author

Keywords

Comments

From Michael Somos, Feb 14 2002: (Start)
The sequence is the resistance between opposite corners of an (n+1)-dimensional hypercube of unit resistors, multiplied by (n+1)!.
The resistances for n+1 = 1,2,3,... are 1, 1, 5/6, 2/3, 8/15, 13/30, 151/420, 32/105, 83/315, 73/315, 1433/6930, ... (see A046878/A046879). (End)
Number of {12,21*,2*1}-avoiding signed permutations in the hyperoctahedral group.
a(n) is the sum of the reciprocals of the binomial coefficients C(n,k), multiplied by n!; example: a(4) = 4!*(1/1 + 1/4 + 1/6 + 1/4 + 1/1) = 64. - Philippe Deléham, May 12 2005
a(n) is the number of permutations on [n+1] that avoid the pattern 13-2|. The absence of a dash between 1 and 3 means the "1" and "3" must be consecutive in the permutation; the vertical bar means the "2" must occur at the end of the permutation. For example, 24153 fails to avoid this pattern: 243 is an offending subpermutation. - David Callan, Nov 02 2005
n!/a(n) is the probability that a random walk on an (n+1)-dimensional hypercube will visit the diagonally opposite vertex before it returns to its starting point. 2^n*a(n)/n! is the expected length of a random walk from one vertex of an (n+1)-dimensional hypercube to the diagonally opposite vertex (a walk which may include one or more passes through the starting point). These "random walk" examples are solutions to IBM's "Ponder This" puzzle for April, 2006. - Graeme McRae, Apr 02 2006
a(n) is the number of strong fixed points in all permutations of {1,2,...,n+1} (a permutation p of {1,2,...,n} is said to have j as a strong fixed point (splitter) if p(k)j for k>j). Example: a(2)=5 because the permutations of {1,2,3}, with marked strong fixed points, are: 1'2'3', 1'32, 312, 213', 231 and 321. - Emeric Deutsch, Oct 28 2008
Coefficients in the asymptotic expansion of exp(-2*x)*Ei(x)^2 for x -> inf, where Ei(x) is the exponential integral. - Vladimir Reshetnikov, Apr 24 2016

References

  • I. P. Goulden and D. M. Jackson, Combinatorial Enumeration, Wiley, N.Y., 1983, (1.1.11 b, p.342).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • R. P. Stanley, Enumerative Combinatorics, Volume 1 (1986), p. 49. [From Emeric Deutsch, Oct 28 2008]

Crossrefs

Cf. A052186, A006932, A145878. - Emeric Deutsch, Oct 28 2008
Cf. A324495, A324496, A324497 (problem similar to the random walks on the hypercube).

Programs

  • GAP
    F:=Factorial;; List([0..20], n-> Sum([0..n], k-> F(k)*F(n-k)) ); # G. C. Greubel, Dec 29 2019
    
  • Magma
    F:=Factorial; [ (&+[F(k)*F(n-k): k in [0..n]]): n in [0..20]]; // G. C. Greubel, Dec 29 2019
    
  • Maple
    seq( add(k!*(n-k)!, k=0..n), n=0..20); # G. C. Greubel, Dec 29 2019
    # second Maple program:
    a:= proc(n) option remember; `if`(n<2, n+1,
          ((3*n+1)*a(n-1)-n^2*a(n-2))/2)
        end:
    seq(a(n), n=0..22);  # Alois P. Heinz, Aug 08 2025
  • Mathematica
    Table[Sum[k!(n-k)!,{k,0,n}],{n,0,20}] (* Harvey P. Dale, Mar 28 2012 *)
    Table[(n+1)!/2^n*Sum[2^k/(k+1),{k,0,n}],{n,0,20}] (* Vaclav Kotesovec, Oct 27 2012 *)
    Round@Table[-2 (n+1)! Re[LerchPhi[2, 1, n+2]], {n, 0, 20}] (* Vladimir Reshetnikov, Nov 12 2015 *)
    Table[(n+1)!*Sum[Binomial[n+1, 2*j+1]/(2*j+1), {j, 0, n}]/2^n, {n, 0, 20}] (* Vaclav Kotesovec, Dec 04 2015 *)
    Series[Exp[-2x] ExpIntegralEi[x]^2, {x, Infinity, 20}][[3]] (* Vladimir Reshetnikov, Apr 24 2016 *)
    Table[2*(-1)^n * Sum[(2^k - 1) * StirlingS1[n, k] * BernoulliB[k], {k, 0, n}], {n, 1, 25}] (* Vaclav Kotesovec, Oct 04 2022 *)
  • PARI
    a(n)=sum(k=0,n,k!*(n-k)!)
    
  • PARI
    a(n)=if(n<0,0,(n+1)!*polcoeff(log(1-x+x^2*O(x^n))/(x/2-1),n+1))
    
  • PARI
    a(n) = my(A = 1, B = 1); for(k=1, n, B *= k; A = (n-k+1)*A + B); A \\ Mikhail Kurkov, Aug 08 2025
    
  • Python
    def a(n: int) -> int:
        if n < 2: return n + 1
        app, ap = 1, 2
        for i in range(2, n + 1):
            app, ap = ap, ((3 * i + 1) * ap - (i * i) * app) >> 1
        return ap
    print([a(n) for n in range(23)])  # Peter Luschny, Aug 08 2025
  • Sage
    f=factorial; [sum(f(k)*f(n-k) for k in (0..n)) for n in (0..20)] # G. C. Greubel, Dec 29 2019
    

Formula

a(n) = n! + ((n+1)/2)*a(n-1), n >= 1. - Leroy Quet, Sep 06 2002
a(n) = ((3n+1)*a(n-1) - n^2*a(n-2))/2, n >= 2. - David W. Wilson, Sep 06 2002; corrected by N. Sato, Jan 27 2010
G.f.: (Sum_{k>=0} k!*x^k)^2. - Vladeta Jovovic, Aug 30 2002
E.g.f: log(1-x)/(x/2 - 1) if offset 1.
Convolution of A000142 [factorial numbers] with itself. - Ross La Haye, Oct 29 2004
a(n) = Sum_{k=0..n+1} k*A145878(n+1,k). - Emeric Deutsch, Oct 28 2008
a(n) = A084938(n+2,2). - Philippe Deléham, Dec 17 2008
a(n) = 2*Integral_{t=0..oo} Ei(t)*exp(-2*t)*t^(n+1) where Ei is the exponential integral function. - Groux Roland, Dec 09 2010
Empirical: a(n-1) = 2^(-n)*(A103213(n) + n!*H(n)) with H(n) harmonic number of order n. - Groux Roland, Dec 18 2010; offset fixed by Vladimir Reshetnikov, Apr 24 2016
O.g.f.: 1/(1-I(x))^2 where I(x) is o.g.f. for A003319. - Geoffrey Critzer, Apr 27 2012
a(n) ~ 2*n!. - Vaclav Kotesovec, Oct 04 2012
a(n) = (n+1)!/2^n * Sum_{k=0..n} 2^k/(k+1). - Vaclav Kotesovec, Oct 27 2012
E.g.f.: 2/((x-1)*(x-2)) + 2*x/(x-2)^2*G(0) where G(k) = 1 + x*(2*k+1)/(2*(k+1) - 4*x*(k+1)^2/(2*x*(k+1) + (2*k+3)/G(k+1) )); (recursively defined continued fraction). - Sergei N. Gladkovskii, Dec 14 2012
a(n) = 2 * n! * (1 + Sum_{k>=1} A005649(k-1)/n^k). - Vaclav Kotesovec, Aug 01 2015
From Vladimir Reshetnikov, Nov 12 2015: (Start)
a(n) = -(n+1)!*Re(Beta(2; n+2, 0))/2^(n+1), where Beta(z; a, b) is the incomplete Beta function.
a(n) = -2*(n+1)!*Re(LerchPhi(2, 1, n+2)), where LerchPhi(z, s, a) is the Lerch transcendent. (End)
a(n) = (n+1)!*(H(n+1) + (n+1)*hypergeom([1, 1, -n], [2, 2], -1))/2^(n+1), where H(n) is the harmonic number. - Vladimir Reshetnikov, Apr 24 2016
Expansion of square of continued fraction 1/(1 - x/(1 - x/(1 - 2*x/(1 - 2*x/(1 - 3*x/(1 - 3*x/(1 - ...))))))). - Ilya Gutkovskiy, Apr 19 2017
a(n) = Sum_{k=0..n+1} (-1)^(n-k)*A226158(k)*Stirling1(n+1, k). - Mélika Tebni, Feb 22 2022
E.g.f.: x/((1-x)*(2-x))-(2*log(1-x))/(2-x)^2+1/(1-x). - Vladimir Kruchinin, Dec 17 2022

Extensions

More terms from Michel ten Voorde, Apr 11 2001

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

A371761 Array read by antidiagonals: The number of parades with n girls and k boys that begin with a girl and end with a boy.

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 5, 1, 0, 0, 1, 13, 13, 1, 0, 0, 1, 29, 73, 29, 1, 0, 0, 1, 61, 301, 301, 61, 1, 0, 0, 1, 125, 1081, 2069, 1081, 125, 1, 0, 0, 1, 253, 3613, 11581, 11581, 3613, 253, 1, 0, 0, 1, 509, 11593, 57749, 95401, 57749, 11593, 509, 1, 0
Offset: 0

Views

Author

Peter Luschny, Apr 05 2024

Keywords

Comments

The name derives from a proposition by Donald Knuth, who describes the setup of a "girls and boys parade" as follows: "There are m girls {g_1, ..., g_m} and n boys {b_1, ..., b_n}, where g_i is younger than g_{i+1} and b_j is younger than b_{j+1}, but we know nothing about the relative ages of g_i and b_j. In how many ways can they all line up in a sequence such that no girl is directly preceded by an older girl and no boy is directly preceded by an older boy?" [Our notation: A <- D, n <- m, k <- n].
In A344920, the Worpitzky transform is defined as a sequence-to-sequence transformation WT := A -> B, where B(n) = Sum_{k=0..n} A163626(n, k)*A(k). (If A(n) = 1/(n + 1) then B(n) are the Bernoulli numbers (with B(1) = 1/2.)) The rows of the array are the Worpitzky transforms of the powers up to the sign (-1)^k.
The array rows are recursively generated by applying the Akiyama-Tanigawa algorithm to the powers (see the Python implementation below). In this way the array becomes the image of A004248 under the AT-transformation when applied to the rows of A004248. This makes the array closely linked to A344499, which is generated in the same way, but applied to the columns of A004248.
Conjecture: Row n + 1 is row 2^n in table A136301, where a probabilistic interpretation is given (see the link to Parsonnet's paper below).

Examples

			Array starts:
[0] 1, 0,   0,     0,      0,       0,        0,         0,          0, ...
[1] 0, 1,   1,     1,      1,       1,        1,         1,          1, ...
[2] 0, 1,   5,    13,     29,      61,      125,       253,        509, ...
[3] 0, 1,  13,    73,    301,    1081,     3613,     11593,      36301, ...
[4] 0, 1,  29,   301,   2069,   11581,    57749,    268381,    1191989, ...
[5] 0, 1,  61,  1081,  11581,   95401,   673261,   4306681,   25794781, ...
[6] 0, 1, 125,  3613,  57749,  673261,  6487445,  55213453,  431525429, ...
[7] 0, 1, 253, 11593, 268381, 4306681, 55213453, 610093513, 6077248381, ...
.
Seen as triangle T(n, k) = A(n - k, k):
  [0] 1;
  [1] 0, 0;
  [2] 0, 1,  0;
  [3] 0, 1,  1,   0;
  [4] 0, 1,  5,   1,   0;
  [5] 0, 1, 13,  13,   1,  0;
  [6] 0, 1, 29,  73,  29,  1, 0;
  [7] 0, 1, 61, 301, 301, 61, 1, 0;
.
A(n, k) as sum of powers:
  A(2, k) =  -3+   2*2^k;
  A(3, k) =   7-  12*2^k+    6*3^k;
  A(4, k) = -15+  50*2^k-   60*3^k+   24*4^k;
  A(5, k) =  31- 180*2^k+  390*3^k-  360*4^k+  120*5^k;
  A(6, k) = -63+ 602*2^k- 2100*3^k+ 3360*4^k- 2520*5^k+  720*6^k;
  A(7, k) = 127-1932*2^k+10206*3^k-25200*4^k+31920*5^k-20160*6^k+5040*7^k;
		

Crossrefs

Variant: A272644.
Rows include: A344920 (row 2, signed), A006230 (row 3).
Row sums of triangle (n>=2): A297195, alternating row sums: A226158.
Diagonal of array: A048144.

Programs

  • Maple
    egf := 1/(exp(w) + exp(z) - exp(w + z)): serw := n -> series(egf, w, n + 1):
    # Returns row n (>= 0) with length len (> 0):
    R := n -> len -> local k;
    seq(k!*coeff(series(n!*coeff(serw(n), w, n), z, len), z, k), k = 0..len - 1):
    seq(lprint(R(n)(9)), n = 0..7);
    # Explicit with Stirling2 :
    A := (n, k) -> local j; add(j!^2*Stirling2(n, j)*Stirling2(k, j), j = 0..min(n, k)): seq(lprint(seq(A(n, k), k = 0..8)), n = 0..7);
    # Using the unsigned Worpitzky transform.
    WT := (a, len) -> local n, k;
    seq(add((-1)^(n - k)*k!*Stirling2(n + 1, k + 1)*a(k), k=0..n), n = 0..len-1):
    Arow := n -> WT(x -> x^n, 8): seq(lprint(Arow(n)), n = 0..8);
    # Two recurrences:
    A := proc(n, k) option remember; local j; if k = 0 then return k^n fi;
    add(binomial(n, j)*(A(n-j, k-1) + A(n-j+1, k-1)), j = 1..n) end:
    A := proc(n, k) option remember; local j; if n = 0 then 0^k else
    add(binomial(k + `if`(j=0,0,1), j+1)*A(n-1, k-j), j = 0..k) fi end:
  • Mathematica
    (* Using the unsigned Worpitzky transform. *)
    Unprotect[Power]; Power[0, 0] = 1;
    W[n_, k_] := (-1)^(n - k) k! StirlingS2[n + 1, k + 1];
    WT[a_, len_] := Table[Sum[W[n, k] a[k], {k, 0, n}], {n, 0, len-1}];
    A371761row[n_, len_] := WT[#^n &, len];
    Table[A371761row[n, 9], {n, 0, 8}] // MatrixForm
    (* Row n >= 1 by linear recurrence: *)
    RowByLRec[n_, len_] := LinearRecurrence[Table[-StirlingS1[n+1, n+1-k], {k, 1, n}],
    A371761row[n, n+1], len]; Table[RowByLRec[n, 9], {n, 1, 8}] // MatrixForm
  • Python
    from functools import cache
    from math import comb as binomial
    @cache
    def A(n, k):
        if n == 0: return int(k == 0)
        return sum(binomial(k + int(j > 0), j + 1) * A(n - 1, k - j)
               for j in range(k + 1))
    for n in range(8): print([A(n, k) for k in range(8)])
    
  • Python
    # The Akiyama-Tanigawa algorithm for powers generates the rows.
    def ATPowList(n, len):
        A = [0] * len
        R = [0] * len
        for k in range(len):
            R[k] = k**n   # Changing this to R[k] = (n + 1)**k generates A344499.
            for j in range(k, 0, -1):
                R[j - 1] = j * (R[j] - R[j - 1])
            A[k] = R[0]
        return A
    for n in range(8): print([n], ATPowList(n, 9))
  • SageMath
    def A371761(n, k): return sum((-1)^(j - k) * factorial(j) * stirling_number2(k + 1, j + 1) * j^n for j in range(k + 1))
    for n in range(9): print([A371761(n, k) for k in range(8)])
    

Formula

A(n, k) = k! * [z^k] (n! * [w^n] 1/(exp(w) + exp(z) - exp(w + z))).
A(n, k) = k! * [w^k] (Sum_{j=0..n} A075263(n, n - j) * exp(j*w)).
A(n, k) = Sum_{j=0..k} (-1)^(j-k) * Stirling2(k + 1, j + 1) * j! * j^n.
A(n, k) = Sum_{j=0..min(n,k)} (j!)^2 * Stirling2(n, j) * Stirling2(k, j).
A(n, k) = Sum_{j=0..n} (-1)^(n-j)*A028246(n, j) * j^k; this is explicit:
A(n, k) = Sum_{j=0..n} Sum_{m=0..n} binomial(n-m, n-j) * Eulerian1(n, m) * j^k *(-1)^(n-j), where Eulerian1 = A173018.
A(n, k) = Sum_{j=0..k} binomial(k + [j>0], j+1)*A(n-1, k-j) for n > 0.
A(n, k) = Sum_{j=1..n} binomial(n, j)*(A(n-j, k-1) + A(n-j+1, k-1)) for n,k >= 1.
Row n (>=1) satisfies a linear recurrence:
A(n, k) = -Sum_{j=1..n} Stirling1(n + 1, n + 1 - j)*A(n, k - j) if k > n.
A(n, k) = [x^k] (Sum_{j=0..n} A371762(n, j)*x^j) / (Sum_{j=0..n} Stirling1(n + 1, n + 1 - j)*x^j).
A(n, k) = A(k, n). (From the symmetry of the bivariate exponential g.f.)
Let T(n, k) = A(n - k, k) and G(n) = Sum_{k=0..n} (-1)^k*T(n, k) the alternating row sums of the triangle. Then G(n) = (n + 2)*Euler(n + 1, 1) and as shifted Genocchi numbers G(n) = -2*(n + 2)*PolyLog(-n - 1, -1) = -A226158(n + 2).
Showing 1-10 of 22 results. Next