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

A109449 Triangle read by rows, T(n,k) = binomial(n,k)*A000111(n-k), 0 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 3, 3, 1, 5, 8, 6, 4, 1, 16, 25, 20, 10, 5, 1, 61, 96, 75, 40, 15, 6, 1, 272, 427, 336, 175, 70, 21, 7, 1, 1385, 2176, 1708, 896, 350, 112, 28, 8, 1, 7936, 12465, 9792, 5124, 2016, 630, 168, 36, 9, 1, 50521, 79360, 62325, 32640, 12810, 4032, 1050, 240, 45, 10, 1
Offset: 0

Views

Author

Philippe Deléham, Aug 27 2005

Keywords

Comments

The boustrophedon transform {t} of a sequence {s} is given by t_n = Sum_{k=0..n} T(n,k)*s(k). Triangle may be called the boustrophedon triangle.
The 'signed version' of the triangle is the exponential Riordan array [sech(x) + tanh(x), x]. - Peter Luschny, Jan 24 2009
Up to signs, the matrix is self-inverse: T^(-1)(n,k) = (-1)^(n+k)*T(n,k). - R. J. Mathar, Mar 15 2013

Examples

			Triangle starts:
      1;
      1,     1;
      1,     2,     1;
      2,     3,     3,     1;
      5,     8,     6,     4,     1;
     16,    25,    20,    10,     5,    1;
     61,    96,    75,    40,    15,    6,    1;
    272,   427,   336,   175,    70,   21,    7,   1;
   1385,  2176,  1708,   896,   350,  112,   28,   8,  1;
   7936, 12465,  9792,  5124,  2016,  630,  168,  36,  9,  1;
  50521, 79360, 62325, 32640, 12810, 4032, 1050, 240, 45, 10, 1; ...
		

Crossrefs

Programs

  • Haskell
    a109449 n k = a109449_row n !! k
    a109449_row n = zipWith (*)
                    (a007318_row n) (reverse $ take (n + 1) a000111_list)
    a109449_tabl = map a109449_row [0..]
    -- Reinhard Zumkeller, Nov 02 2013
    
  • Magma
    f:= func< n,x | Evaluate(BernoulliPolynomial(n+1), x) >;
    A109449:= func< n,k | k eq n select 1 else 2^(2*n-2*k+1)*Binomial(n,k)*Abs(f(n-k,3/4) - f(n-k,1/4) + f(n-k,1) - f(n-k,1/2))/(n-k+1) >;
    [A109449(n,k): k in [0..n], n in [0..13]]; // G. C. Greubel, Jul 10 2025
  • Maple
    From Peter Luschny, Jul 10 2009, edited Jun 06 2022: (Start)
    A109449 := (n,k) -> binomial(n, k)*A000111(n-k):
    seq(print(seq(A109449(n, k), k=0..n)), n=0..9);
    B109449 := (n,k) -> 2^(n-k)*binomial(n, k)*abs(euler(n-k, 1/2)+euler(n-k, 1)) -`if`(n-k=0, 1, 0): seq(print(seq(B109449(n, k), k=0..n)), n=0..9);
    R109449 := proc(n, k) option remember; if k = 0 then A000111(n) else R109449(n-1, k-1)*n/k fi end: seq(print(seq(R109449(n, k), k=0..n)), n=0..9);
    E109449 := proc(n) add(binomial(n, k)*euler(k)*((x+1)^(n-k)+ x^(n-k)), k=0..n) -x^n end: seq(print(seq(abs(coeff(E109449(n), x, k)), k=0..n)), n=0..9);
    sigma := n -> ifelse(n=0, 1, [1,1,0,-1,-1,-1,0,1][n mod 8 + 1]/2^iquo(n-1,2)-1):
    L109449 := proc(n) add(add((-1)^v*binomial(k, v)*(x+v+1)^n*sigma(k), v=0..k), k=0..n) end: seq(print(seq(abs(coeff(L109449(n), x, k)), k=0..n)), n=0..9);
    X109449 := n -> n!*coeff(series(exp(x*t)*(sech(t)+tanh(t)), t, 24), t, n): seq(print(seq(abs(coeff(X109449(n), x, k)), k=0..n)), n=0..9);
    (End)
  • Mathematica
    lim = 10; s = CoefficientList[Series[(1 + Sin[x])/Cos[x], {x, 0, lim}], x] Table[k!, {k, 0, lim}]; Table[Binomial[n, k] s[[n - k + 1]], {n, 0, lim}, {k, 0, n}] // Flatten (* Michael De Vlieger, Dec 24 2015, after Jean-François Alcover at A000111 *)
    T[n_, k_] := (n!/k!) SeriesCoefficient[(1 + Sin[x])/Cos[x], {x, 0, n - k}]; Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 27 2019 *)
  • PARI
    A109449(n,k)=binomial(n,k)*if(n>k,2*abs(polylog(k-n,I)),1) \\ M. F. Hasler, Oct 05 2017
    
  • Sage
    R = PolynomialRing(ZZ, 'x')
    @CachedFunction
    def skp(n, x) :
        if n == 0 : return 1
        return add(skp(k, 0)*binomial(n, k)*(x^(n-k)-(n+1)%2) for k in range(n)[::2])
    def A109449_row(n):
        x = R.gen()
        return [abs(c) for c in list(skp(n,x)-skp(n,x-1)+x^n)]
    for n in (0..10) : print(A109449_row(n)) # Peter Luschny, Jul 22 2012
    

Formula

Sum_{k>=0} T(n, k) = A000667(n).
Sum_{k>=0} T(2n, 2k) = A000795(n).
Sum_{k>=0} T(2n, 2k+1) = A009747(n).
Sum_{k>=0} T(2n+1, 2k) = A003719(n).
Sum_{k>=0} T(2n+1, 2k+1) = A002084(n).
Sum_{k>=0} T(n, 2k) = A062272(n).
Sum_{k>=0} T(n, 2k+1) = A062161(n).
Sum_{k>=0} (-1)^(k)*T(n, k) = A062162(n). - Johannes W. Meijer, Apr 20 2011
E.g.f.: exp(x*y)*(sec(x)+tan(x)). - Vladeta Jovovic, May 20 2007
T(n,k) = 2^(n-k)*C(n,k)*|E(n-k,1/2) + E(n-k,1)| - [n=k] where C(n,k) is the binomial coefficient, E(m,x) are the Euler polynomials and [] the Iverson bracket. - Peter Luschny, Jan 24 2009
From Reikku Kulon, Feb 26 2009: (Start)
A109449(n, 0) = A000111(n), approx. round(2^(n + 2) * n! / Pi^(n + 1)).
A109449(n, n - 1) = n.
A109449(n, n) = 1.
For n > 0, k > 0: A109449(n, k) = A109449(n - 1, k - 1) * n / k. (End)
From Peter Luschny, Jul 10 2009: (Start)
Let p_n(x) = Sum_{k=0..n} Sum_{v=0..k} (-1)^v C(k,v)*F(k)*(x+v+1)^n, where F(0)=1 and for k>0 F(k)=-1 + s_k 2^floor((k-1)/2), s_k is 0 if k mod 8 in {2,6}, 1 if k mod 8 in {0,1,7} and otherwise -1. T(n,k) are the absolute values of the coefficients of these polynomials.
Another way to express the polynomials p_n(x) is
p_n(x) = -x^n + Sum_{k=0..n} binomial(n,k)*Euler(k)((x+1)^(n-k) + x^(n-k)). (End)
From Peter Bala, Jan 26 2011: (Start)
An explicit formula for the n-th row polynomial is
x^n + i*Sum_{k=1..n}((1+i)/2)^(k-1)*Sum_{j=0..k} (-1)^j*binomial(k,j)*(x+i*j)^n, where i = sqrt(-1). This is the triangle of connection constants between the polynomial sequences {Z(n,x+1)} and {Z(n,x)}, where Z(n,x) denotes the zigzag polynomials described in A147309.
Denote the present array by M. The first column of the array (I-x*M)^-1 is a sequence of rational functions in x whose numerator polynomials are the row polynomials of A145876 - the generalized Eulerian numbers associated with the zigzag numbers. (End)
Let skp{n}(x) denote the Swiss-Knife polynomials A153641. Then
T(n,k) = [x^(n-k)] |skp{n}(x) - skp{n}(x-1) + x^n|. - Peter Luschny, Jul 22 2012
T(n,k) = A007318(n,k) * A000111(n - k), k = 0..n. - Reinhard Zumkeller, Nov 02 2013
T(n,k) = abs(A247453(n,k)). - Reinhard Zumkeller, Sep 17 2014

Extensions

Edited, formula corrected, typo T(9,4)=2016 (before 2816) fixed by Peter Luschny, Jul 10 2009

A147315 L-matrix for Euler numbers A000111(n+1).

Original entry on oeis.org

1, 1, 1, 2, 3, 1, 5, 11, 6, 1, 16, 45, 35, 10, 1, 61, 211, 210, 85, 15, 1, 272, 1113, 1351, 700, 175, 21, 1, 1385, 6551, 9366, 5901, 1890, 322, 28, 1, 7936, 42585, 70055, 51870, 20181, 4410, 546, 36, 1, 50521, 303271, 563970, 479345, 218925, 58107, 9240, 870, 45, 1
Offset: 0

Views

Author

Paul Barry, Nov 05 2008

Keywords

Comments

This is the inverse of the coefficient array for the orthogonal polynomials p(n,x) defined by: p(n,x)=if(n=-1,0,if(n=0,1,(x-n)p(n-1,x)-C(n,2)p(n-2,x))).
The Hankel array H for A000111(n+1) satisfies H=L*D*U with U the transpose of L.
Row sums are A000772(n+1) with e.g.f. dif(exp(-1)exp(sec(x)+tan(x)),x).
From Peter Bala, Jan 31 2011: (Start)
The following comments refer to the table with an offset of 1: i.e., both the row and column indexing starts at 1.
An increasing tree is a labeled rooted tree with the property that the sequence of labels along any path starting from the root is increasing. A000111(n) for n>=1 enumerates the number of increasing unordered trees on the vertex set {1,2,...,n}, rooted at 1, in which all outdegrees are <=2 (plane unary-binary trees in the notation of [Bergeron et al.])
The entry T(n,k) of the present table gives the number of forests of k increasing unordered trees on the vertex set {1,2,...,n} in which all outdegrees are <=2. See below for some examples.
For ordered forests of such trees see A185421. For forests of increasing ordered trees on the vertex set {1,2,...,n}, rooted at 1, in which all outdegrees are <=2, see A185422.
The Stirling number of the second kind Stirling2(n,k) is the number of partitions of the set [n] into k blocks. Arranging the elements in each block in ascending numerical order provides an alternative combinatorial interpretation for Stirling2(n,k) as counting forests of k increasing unary trees on n nodes. Thus we may view the present array, which counts increasing unary-binary trees, as generalized Stirling numbers of the second kind associated with A000111 or with the zigzag polynomials Z(n,x) of A147309 - see especially formulas (2) and (3) below.
See A145876 for generalized Eulerian numbers associated with A000111. (End)
The Bell transform of A000111(n+1). For the definition of the Bell transform see A264428. - Peter Luschny, Jan 18 2016

Examples

			Triangle begins
    1;
    1,    1;
    2,    3,    1;
    5,   11,    6,   1;
   16,   45,   35,  10,   1;
   61,  211,  210,  85,  15,  1;
  272, 1113, 1351, 700, 175, 21, 1;
  ...
The production array for L is the tridiagonal array
  1,  1;
  1,  2,  1;
  0,  3,  3,  1;
  0,  0,  6,  4,  1;
  0,  0,  0, 10,  5,  1;
  0,  0,  0,  0, 15,  6,  1;
  0,  0,  0,  0,  0, 21,  7,  1;
  0,  0,  0,  0,  0,  0, 28,  8,  1,;
  0,  0,  0,  0,  0,  0,  0, 36,  9,  1;
From _Peter Bala_, Jan 31 2011: (Start)
Examples of forests:
The diagrams below are drawn so that the leftmost child of a binary node has the maximum label.
T(4,1) = 5. The 5 forests consisting of a single non-plane increasing unary-binary tree on 4 nodes are
...4... ........ .......... ........... ...........
...|... ........ .......... ........... ...........
...3... .4...3.. .4........ ........4.. ........3..
...|... ..\./... ..\....... ......./... ......./...
...2... ...2.... ...3...2.. ..3...2.... ..4...2....
...|... ...|.... ....\./... ...\./..... ...\./.....
...1... ...1.... .....1.... ....1...... ....1......
T(4,2) = 11. The 11 forests consisting of two non-plane increasing unary-binary trees on 4 nodes are
......... ...3.....
.3...2... ...|.....
..\./.... ...2.....
...1...4. ...|.....
......... ...1...4.
.
......... ...4.....
.4...2... ...|.....
..\./.... ...2.....
...1...3. ...|.....
......... ...1...3.
.
......... ...4.....
.4...3... ...|.....
..\./.... ...3.....
...1...2. ...|.....
......... ...1...2.
.
......... ...4.....
.4...3... ...|.....
..\./.... ...3.....
...2...1. ...|.....
......... ...2...1.
.
......... ......... ..........
..2..4... ..3..4... ..4...3...
..|..|... ..|..|... ..|...|...
..1..3... ..1..2... ..1...2...
......... ......... .......... (End)
		

Crossrefs

Programs

  • Maple
    A147315 := proc(n,k) n!*exp(x*(sec(t)+tan(t)-1)) - 1: coeftayl(%,t=0,n) ; coeftayl(%,x=0,k) ; end proc:
    seq(seq(A147315(n,k),k=1..n),n=0..12) ; # R. J. Mathar, Mar 04 2011
    # second Maple program:
    b:= proc(u, o) option remember;
          `if`(u+o=0, 1, add(b(o-1+j, u-j), j=1..u))
        end:
    g:= proc(n) option remember; expand(`if`(n=0, 1, add(
          g(n-j)*x*binomial(n-1, j-1)*b(j, 0), j=1..n)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..n+1))(g(n+1)):
    seq(T(n), n=0..10);  # Alois P. Heinz, May 19 2021
  • Mathematica
    t[n_, k_] := t[n, k] = t[n-1, k-1] + (k+1)*t[n-1, k] + 1/2*(k+1)*(k+2)*t[n-1, k+1]; t[n_, k_] /; (n < 0 || k < 0 || k > n) = 0; t[0, 0] = t[1, 0] = 1; Flatten[Table[t[n, k], {n, 0, 9}, {k, 0, n}]][[1 ;; 47]] (* Jean-François Alcover, Jun 21 2011, after PARI prog. *)
  • Maxima
    Co(n,k):=sum(binomial(k,j)*(if oddp(n-k+j) then 0 else if (n-k+j)/2A147315(n,m):=1/m!*sum((if oddp(n-k) then 0 else 2^(1-k)*sum((-1)^(floor((n+k)/2)-i)*binomial(k,i)*(2*i-k)^n,i,0,floor(k/2)))*(sum(Co(i,m)*binomial(k-i+m-1,m-1),i,1,k)),k,m,n); /* Vladimir Kruchinin, Feb 17 2011 */
    
  • Maxima
    T(n,m):=(sum(binomial(k+m,m)*((-1)^(n-k-m)+1)*sum(binomial(j+k+m,k+m)*(j+k+m+1)!*2^(-j-k-1)*(-1)^((n+k+m)/2+j+k+m)*stirling2(n+1,j+k+m+1), j,0,n-k-m), k,0,n-m))/(m+1)!; /* Vladimir Kruchinin, May 17 2011 */
    
  • PARI
    {T(n,k)=if(k<0||k>n,0,if(n==0,1,T(n-1,k-1)+(k+1)*T(n-1,k)+(k+1)*(k+2)/2*T(n-1,k+1)))} /* offset=0 */
    
  • PARI
    {T(n,k)=local(X=x+x*O(x^(n+2)));(n+1)!*polcoeff(polcoeff(exp(y*((1+sin(X))/cos(X)-1))-1,n+1,x),k+1,y)} /* offset=0 */
    
  • PARI
    /* Generate from the production matrix P: */
    {T(n,k)=local(P=matrix(n,n,r,c,if(r==c-1,1,if(r==c,c,if(r==c+1,c*(c+1)/2)))));if(k<0||k>n,0,if(n==k,1,(P^n)[1,k+1]))}
    
  • Sage
    # uses[bell_matrix from A264428, A000111]
    # Adds a column 1,0,0,0, ... at the left side of the triangle.
    bell_matrix(lambda n: A000111(n+1), 10) # Peter Luschny, Jan 18 2016

Formula

From Peter Bala, Jan 31 2011: (Start)
The following formulas refer to the table with an offset of 1: i.e., both the row n and column k indexing start at 1.
GENERATING FUNCTION
E.g.f.:
(1)... exp(x*(sec(t)+tan(t)-1)) - 1 = Sum_{n>=1} R(n,x)*t^n/n!
= x*t + (x+x^2)*t^2/2! + (2*x+3*x^2+x^3)*t^3/3! + ....
TABLE ENTRIES
(2)... T(n,k) = (1/k!)*Sum_{j = 0..k} (-1)^(k-j)*binomial(k,j)*Z(n,j),
where Z(n,x) denotes the zigzag polynomials as described in A147309.
Compare (2) with the formula for the Stirling numbers of the second kind
(3)... Stirling2(n,k) = (1/k!)*Sum_{j = 0..k} (-1)^(k-j)*binomial(k,j)*j^n.
Recurrence relation
(4)... T(n+1,k) = T(n,k-1) + k*T(n,k) + (1/2)*k(k+1)*T(n,k+1).
ROW POLYNOMIALS
The row polynomials R(n,x) begin
R(1,x) = x
R(2,x) = x+x^2
R(3,x) = 2*x+3*x^2+x^3
They satisfy the recurrence
(5)... R(n+1,x) = x*{R(n,x)+R'(n,x) + (1/2)*R''(n,x)},
where ' indicates differentiation with respect to x. This should be compared with the recurrence satisfied by the Bell polynomials Bell(n,x)
(6)... Bell(n+1,x) = x*(Bell(n,x) + Bell'(n,x)). (End)
From Vladimir Kruchinin, Feb 17 2011: (Start)
Sum_{m=1..n} T(n,m) = A000772(n).
Sum_{m=1..2n-1} T(2n-1,m)* Stirling1(m,1) = A000364(n).
Let Co(n,k) = Sum_{j=1..k} binomial(k,j)*(if (n-k+j) is odd then 0 else if (n-k+j)/2
T(n,m) = m!* Sum_{k=m..n} (if n-k is odd then 0 else 2^(1-k)) * Sum_{i=0..floor(k/2)} (-1)^(floor((n+k)/2)-i) * binomial(k,i) * (2*i-k)^n)))) * Sum_{i=1..k} Co(i,m) * binomial(k-i+m-1,m-1), n>0.
(End)
T(n,m) = Sum_{k = 0..n-m} binomial(k+m,m)*((-1)^(n-k-m)+1)*Sum_{j=0..n-k-m} binomial(j+k+m,k+m)*(j+k+m+1)!*2^(-j-k-1)*(-1)^((n+k+m)/2+j+k+m)* Stirling2(n+1,j+k+m+1)/(m+1)!. - Vladimir Kruchinin, May 17 2011
The row polynomials R(n,x) are given by D^n(exp(x*t)) evaluated at t = 0, where D is the operator (1+t+t^2/2!)*d/dt. Cf. A008277 and A094198. See also A185422. - Peter Bala, Nov 25 2011

Extensions

More terms from Michel Marcus, Mar 01 2014

A320956 a(n) = A000110(n) * A000111(n). The exponential limit of sec + tan. Row sums of A373428.

Original entry on oeis.org

1, 1, 2, 10, 75, 832, 12383, 238544, 5733900, 167822592, 5859172975, 240072637440, 11388362495705, 618357843791872, 38057876106154882, 2632817442236631040, 203225803724876875315, 17390464322078045896704, 1640312648221489789841119, 169667967895669459925991424
Offset: 0

Author

Peter Luschny, Nov 07 2018

Keywords

Comments

We say that the sequence S is the exponential limit of the function f relative to the kernel K if and only if the exponential generating functions
egf(n) = Sum_{k=0..n} K(n, k)*f(x*(n-k)) generate a family of sequences
T(n) = k -> (k!/n!)*[x^k] egf(n) which converge to S. Convergence here means that for every fixed k the terms T(n)(k) differ from S(k) only for finitely many indices.
The paradigmatic example is to set f(x) = exp(x), K(n, k) = !k*binomial(n, k) (!n is the subfactorial of n) and obtain for S the Bell numbers. This example is set forth in A320955.
Let D(f)(x) represent the derivative of f(x) with respect to x and (D^(n))(f) the n-th derivative of f. Then the exponential limit of f is B(n)*((D^(n))(f))(0) where B(n) is the n-th Bell number: ExpLim(f) = f(0), (D(f))(0), 2*((D^(2))(f))(0), 5*((D^(3))(f))(0), 15*((D^(4))(f))(0), 52*((D^(5))(f))(0), ... Since exp is a fixed point of D and exp(0) = 1 we have the identity ExpLim(exp)[n] = B(n). Similarly ExpLim(sin)[n] = B(n)*mod(n,2)*(-1)^binomial(n,2).
If we set f = sec + tan and K(n, k) = !k*binomial(n, k) the exponential limit is this sequence, a(n).

Examples

			Illustration of the convergence:
  [0] 1, 0, 0,  0,  0,   0,     0,      0,       0, ... A000007
  [1] 1, 1, 1,  2,  5,  16,    61,    272,    1385, ... A000111
  [2] 1, 1, 2,  8, 40, 256,  1952,  17408,  177280, ... A000828
  [3] 1, 1, 2, 10, 70, 656,  7442,  99280, 1515190, ... A320957
  [4] 1, 1, 2, 10, 75, 816, 11407, 194480, 3871075, ... A321394
  [5] 1, 1, 2, 10, 75, 832, 12322, 232560, 5325325, ...
  [6] 1, 1, 2, 10, 75, 832, 12383, 238272, 5693735, ...
  [7] 1, 1, 2, 10, 75, 832, 12383, 238544, 5732515, ...
  [8] 1, 1, 2, 10, 75, 832, 12383, 238544, 5733900, ...
		

Crossrefs

Cf. A000111 (n=1), A000828 (n=2), A320957 (n=3), A321394 (n=4).
Cf. A320955 (exp), A320962 (log(x+1)), this sequence (sec+tan), A320958 (arcsin), A320959 (arctanh).
Cf. A373428.

Programs

  • Maple
    ExpLim := proc(len, f) local kernel, sf, egf:
    sf := proc(n) option remember; `if`(n <= 1, 1 - n, (n-1)*(sf(n-1) + sf(n-2))) end:
    kernel := proc(n, k) option remember; binomial(n, k)*sf(k) end:
    egf := n -> add(kernel(n, k)*f(x*(n-k)), k=0..n):
    series(egf(len), x, len+2): seq(coeff(%, x, k)*k!/len!, k=0..len) end:
    ExpLim(19, sec + tan);
    # Alternative:
    explim := (len, f) -> seq(combinat:-bell(n)*((D@@n)(f))(0), n=0..len):
    explim(19, sec + tan);
    # Or:
    a := n -> A000110(n)*A000111(n): seq(a(n), n = 0..19);  # Peter Luschny, Jun 07 2024
  • Mathematica
    m = 20; CoefficientList[Sec[x] + Tan[x] + O[x]^m, x] * Range[0, m-1]! *
    BellB[Range[0, m-1]] (* Jean-François Alcover, Jun 19 2019 *)

Extensions

Name extended by Peter Luschny, Jun 07 2024

A132049 Numerator of 2*n*A000111(n-1)/A000111(n): approximations of Pi, using Euler (up/down) numbers.

Original entry on oeis.org

2, 4, 3, 16, 25, 192, 427, 4352, 12465, 158720, 555731, 8491008, 817115, 626311168, 2990414715, 60920233984, 329655706465, 7555152347136, 45692713833379, 232711080902656, 7777794952988025, 217865914337460224
Offset: 1

Author

Wolfdieter Lang Sep 14 2007

Keywords

Comments

The denominators are given in A132050.
a(n)/n = 2, 2, 1, 4, 5, 32, 61, 544, ... are integers for n<=19. a(20)/20 = 58177770225664/5. - Paul Curtz, Mar 25 2013, Apr 04 2013

Examples

			Rationals r(n): [3, 16/5, 25/8, 192/61, 427/136, 4352/1385, 12465/3968, 158720/50521, ...].
		

References

  • J.-P. Delahaye, Pi - die Story (German translation), Birkhäuser, 1999 Basel, p. 31. French original: Le fascinant nombre Pi, Pour la Science, Paris, 1997.

Crossrefs

Cf. triangle A008281 (main diagonal give zig-zag numbers A000111), A223925.

Programs

  • Maple
    S := proc(n, k) option remember;
    if k=0 then `if`(n=0,1,0) else S(n,k-1)+S(n-1,n-k) fi end:
    R := n -> 2*n*S(n-1,n-1)/S(n,n);
    A132049 := n -> numer(R(n)); A132050 := n -> denom(R(n));
    seq(A132049(i),i=3..22); # Peter Luschny, Aug 04 2011
  • Mathematica
    e[n_] := If[EvenQ[n], Abs[EulerE[n]], Abs[(2^(n+1)*(2^(n+1) - 1)*BernoulliB[n+1])/(n+1)]]; r[n_] := 2*n*(e[n-1]/e[n]); a[n_] := Numerator[r[n]]; Table[a[n], {n, 3, 22}] (* Jean-François Alcover, Mar 18 2013 *)
  • Python
    from itertools import islice, count, accumulate
    from fractions import Fraction
    def A132049_gen(): # generator of terms
        yield 2
        blist = (0,1)
        for n in count(2):
            yield Fraction(2*n*blist[-1],(blist:=tuple(accumulate(reversed(blist),initial=0)))[-1]).numerator
    A132049_list = list(islice(A132049_gen(),40)) # Chai Wah Wu, Jun 09-11 2022

Formula

a(n)=numerator(r(n)) with the rationals r(n)=2*n*e(n-1)/e(n), where e(n)=A000111(n) ("zig-zag" or "up-down" numbers), i.e., e(2*k)=A000364(k) (Euler numbers, secant numbers, "zig"-numbers) and e(2*k+1)=A000182(k+1),k>=0, (tangent numbers, "zag"-numbers). Rationals in lowest terms.

Extensions

Entries confirmed by N. J. A. Sloane, May 10 2012
More explicit definition from M. F. Hasler, Apr 03 2013
a(1) and a(2) prepended by Paul Curtz, Apr 04 2013

A000708 a(n) = E(n+1) - 2*E(n), where E(i) is the Euler number A000111(i).

Original entry on oeis.org

-1, -1, 0, 1, 6, 29, 150, 841, 5166, 34649, 252750, 1995181, 16962726, 154624469, 1505035350, 15583997521, 171082318686, 1985148989489, 24279125761950, 312193418011861, 4210755676649046, 59445878286889709, 876726137720576550, 13483686390543382201
Offset: 0

Keywords

Comments

a(n) mod 10 for n >= 2 is the periodic sequence repeat: 0, 1, 6, 9.
For n >= 2, a(n) is the number of permutations on [n] that have n-2 "sequences" (which are maximal monotone runs in Comtet terminology) and start increasing. - Michael Somos, Aug 28 2013
From Petros Hadjicostas, Aug 07 2019: (Start)
With regard to the comment by Michael Somos above, a "sequence" in a permutation according to Ex. 13 (pp. 260-261) of Comtet (1974) is actually a "séquence" in a permutation according to André. He uses this terminology in several of his papers cited in the links below.
In the terminology of array A059427, these so-called "séquences" in permutations defined by Comtet and André are called "alternate runs" (or just "runs"). We discuss these so-called "sequences" below.
We clarify that a(n) is actually one-half the number of permutations on [n] that have n-2 "séquences" as defined by Comtet and André.
André (1884) defines a "maximum" of a permutation of [n] to be any number in the permutation that is greater than both of its neighbors, if it is an interior number, or greater than its single neighbor, if it is either at the beginning or at the end of the permutation.
André (1884) also defines a "minimum" of a permutation of [n] to be any number in the permutation that is less than both of its neighbors, if it is an interior number, or less than its single neighbor, if it is either at the beginning or at the end of the permutation.
A "séquence" in a permutation of [n] according to André and Comtet is a list of consecutive numbers in the permutation that begins with a maximum and ends with a minimum, or vice versa, but has no interior maxima and minima. As mentioned above, other authors call these so-called "séquences" "alternate runs" (or just "runs").
For example, in the permutation 78125436 of [8], we have three maxima, 8, 5, and 6; three minima, 7, 1, and 3; and the so-called "séquences" ("alternate runs") 78, 81, 125, 543, 36 (see p. 122 in André (1884)).
If in the above permutation we take the difference 8-7, 1-8, 2-1, 5-2, 4-5, 3-4, 6-3, we may form a word (list) of signs of consecutive differences: +-++--+.
In general, if in a permutation of [n], say a_1,a_2,...,a_n (written in one-line notation, but not in cycle notation), we form the differences a_2 - a_1, a_3 - a_2, ..., a_n - a_{n-1}, then we get a list of n-1 signs (+ or -).
For n >= 2, André (1885) calls a permutation of [n] "alternate" if it has n - 1 so-called "séquences" ("alternate runs"); i.e., if the corresponding list of signs alternates between + and -. See the documentation and references for sequences A000111 and A001250.
For n >= 2, André (1885) calls a permutation of [n] "quasi-alternate" if it has n - 2 so-called "séquences" ("alternate runs"); i.e., if the corresponding list of signs alternates between + and - except for a single ++ or a single --, but not both.
In the above example, the permutation 78125436 has 5 so-called "séquences" ("alternate signs") and 5 < 8-2 < 8-1; that is, it is neither alternate nor quasi-alternate. We can reach the same conclusion by looking at its corresponding list of signs +-++--+. The permutation is neither alternate nor quasi-alternate because we have one ++ and one --.
On p. 316, André (1885) gives the following two examples of permutations of [8]: 31426587 and 32541768 (using one-line notation for permutations). The first one has list of signs -+-+-+- while the second one has list of signs -+--+-+. The first one is alternate while the second one is quasi-alternate (because of a single --). Alternatively, the first one has n-1 = 7 so-called "séquences" ("alternate runs")--31, 14, 42, 26, 65, 58, 87--while the second one has n-2 = 6 so-called "séquences" ("alternate runs")--32, 25, 541, 17, 76, 68.
Here 2*a(n) is the total number of quasi-alternate permutations of [n]. Actually, André (1884, 1885) uses P_{n,s} to denote the number of permutations of [n] with exactly s of his so-called "séquences" ("alternate runs"). He uses the notation A_n to denote half the number of alternate permutations of [n] and B_n to denote half the number of quasi-alternate permutations of [n].
Thus, P_{n,n-1} = 2*A_n = 2*A000111(n) = A001250(n) for n >= 2 and P_{n,n-2} = 2*B_n = 2*a(n) for n >= 2.
We have P_{n,s} = A059427(n,s) for n >= 2 and s >= 1. See also p. 261 in Comtet (1974). They satisfy André's recurrence P_{n,s} = s*P_{n-1,s} + 2*P_{n-1,s-1} + (n-s)*P_{n-1,s-2} for n >= 3 and s >= 3 with P(n, 1) = 2 for n >= 2 and P(n, s) = 0 for s >= n.
The numbers Q(n,s) that count the circular permutations of [n] with exactly s so-called "séquences" ("alternate runs") appear in array A008303. They have also been studied by Désiré André (see the references there).
(End)

Examples

			G.f. = -1 - x + x^3 + 6*x^4 + 29*x^5 + 150*x^6 + 841*x^7 + 5166*x^8 + 34649*x^9 + ...
a(3) = 1 with permutation 123. a(4) = 6 with permutations 1243, 1342, 1432, 2341, 2431, 3421.
From _Petros Hadjicostas_, Aug 07 2019: (Start)
We elaborate on the example above. For the permutations of [3], we have the following sign sequences:
123 -> ++; 132 --> +-; 213 -> -+; 213 -> 213; 231 -> +-; 312 -> -+; 321 --> --.
Thus, 123 and 321 are quasi-alternate and a(3) = 2/2 = 1.
For the permutations of [4] we have:
  1234 -> +++ (neither alternate nor quasi-alternate);
  1243 -> ++- (quasi-alternate);
  1324 -> +-+ (alternate);
  1342 -> ++- (quasi-alternate);
  1423 -> +-+ (alternate);
  1432 -> +-- (quasi-alternate);
  2134 -> -++ (quasi-alternate);
  2143 -> -+- (alternate);
  2314 -> +-+ (alternate);
  2341 -> ++- (quasi-alternate);
  2413 -> +-+ (alternate);
  2431 -> +-- (quasi-alternate);
  3124 -> -++ (quasi-alternate);
  3142 -> -+- (alternate);
  3214 -> --+ (quasi-alternate);
  3241 -> -+- (alternate);
  3412 -> +-+ (alternate);
  3421 -> +-- (quasi-alternate);
  4123 -> -++ (quasi-alternate);
  4132 -> -+- (alternate);
  4213 -> --+ (quasi-alternate);
  4231 -> -+- (alternate);
  4312 -> --+ (quasi-alternate);
  4321 -> --- (neither alternate nor quasi-alternate).
Thus we have 10 = 2*A000111(4) = A001250(4) alternate permutations of [4] and 2*a(4) = 2*6 = 12 quasi-alternate permutations of [4]. The remaining 2 permutations (1234 and 4321) each have one so-called "séquence" ("alternate run").
Thus, P_{n=4, s=1} = 2, P_{n=4, s=2} = 12, and P_{n=4, s=10} = 10 (see row n = 4 for array A059427).
(End)
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 261.
  • E. Netto, Lehrbuch der Combinatorik. 2nd ed., Teubner, Leipzig, 1927, p. 113.
  • 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

Apart from initial terms, equals (1/2)*A001758. A diagonal of A008970.

Programs

  • Maple
    seq(i! * coeff(series((1 + (tan(t) + sec(t))^2 - 4*(tan(t) + sec(t))) / 2, t, 35), t, i), i=0..24); # Barbara Haas Margolius (margolius(AT)math.csuohio.edu), Mar 12 2001
  • Mathematica
    a[ n_] := If[ n < 0, 0, n! SeriesCoefficient[ (1 - 2 Cos[x]) / (1 - Sin[x]), {x, 0, n}]]; (* Michael Somos, Aug 28 2013 *)
    nmax = 22; ee = Table[2^n*EulerE[n, 1] + EulerE[n], {n, 0, nmax+1}]; dd = Table[Differences[ee, n][[1]] // Abs, {n, 0, nmax+1}]; a[n_] := dd[[n+2]] - 2dd[[n+1]]; a[0] = -1; Table[a[n], {n, 0, nmax}] (* Jean-François Alcover, Feb 10 2016, after Paul Curtz *)
    Table[If[n == 0, -1, 2 Abs[PolyLog[-n-1, I]] - 4 Abs[PolyLog[-n, I]]], {n, 0, 22}] (* Jean-François Alcover, Jul 01 2017 *)
  • PARI
    x='x+O('x^99); Vec(serlaplace((1-2*cos(x))/(1-sin(x))))
    
  • Python
    from mpmath import polylog, j, mp
    mp.dps=20
    def a(n): return -1 if n==0 else int(2*abs(polylog(-n - 1, j)) - 4*abs(polylog(-n, j)))
    print([a(n) for n in range(23)])  # Indranil Ghosh, Jul 02 2017
    
  • Python
    from itertools import count, islice, accumulate
    def A000708_gen(): # generator of terms
        yield -1
        blist = (0,1)
        for n in count(2):
            yield -2*blist[-1]+(blist:=tuple(accumulate(reversed(blist),initial=0)))[-1]
    A000708_list = list(islice(A000708_gen(),40)) # Chai Wah Wu, Jun 09-11 2022

Formula

E.g.f.: (1 - 2*cos(x)) / (1 - sin(x)).
a(n) ~ n! * 2*n*(2/Pi)^(n+2). - Vaclav Kotesovec, Oct 08 2013
a(n) = 2*abs(PolyLog(-n-1, i)) - 4*abs(PolyLog(-n, i)) for n > 0, with a(0) = -1. - Jean-François Alcover, Jul 02 2017

Extensions

More terms from Barbara Haas Margolius (margolius(AT)math.csuohio.edu), Mar 12 2001
Corrected and extended by T. D. Noe, Oct 25 2006
Edited by N. J. A. Sloane, Aug 27 2012

A132050 Denominator of 2*n*A000111(n-1)/A000111(n): approximations of Pi using Euler (up/down) numbers.

Original entry on oeis.org

1, 1, 1, 5, 8, 61, 136, 1385, 3968, 50521, 176896, 2702765, 260096, 199360981, 951878656, 19391512145, 104932671488, 2404879675441, 14544442556416, 74074237647505, 2475749026562048, 69348874393137901, 507711943253426176
Offset: 1

Author

Wolfdieter Lang, Sep 14 2007

Keywords

Comments

The rationals r(n)=2*n*e(n-1)/e(n), where e(n)=A000111(n), approximate Pi as n -> oo. - M. F. Hasler, Apr 03 2013
Numerators are given in A132049.
See the Delahaye reference and a link by W. Lang given in A132049.
From Paul Curtz, Mar 17 2013: (Start)
Apply the Akiyama-Tanigawa transform (or algorithm) to A046978(n+2)/A016116(n+1):
1, 1/2, 0, -1/4, -1/4, -1/8, 0, 1/16, 1/16;
1/2, 1, 3/4, 0, -5/8, -3/4, -7/16, 0; = Balmer0(n)
-1/2, 1/2, 9/4, 5/2, 5/8, -15/8, -49/16;
-1, -7/2, -3/4, 15/2, 25/2, 57/8;
5/2, -11/2, -99/4, -20, 215/8;
8, 77/2, -57/4, -375/2;
-61/2, 211/2, 2079/4;
-136, -1657/2;
1385/2;
The first column is PIEULER(n) = 1, 1/2, -1/2, -1, 5/2, 8, -61/2, -136, 1385/2,... = c(n)/d(n). Abs c(n+1)=1,1,1,5,8,61,... =a(n) with offset=1.
For numerators of Balmer0(n) see A076109, A000265 and A061037(n-1) (End).
Other completely unrelated rational approximations of Pi are given by A063674/A063673 and other references there. - M. F. Hasler, Apr 03 2013

Examples

			Rationals r(n): [2, 4, 3, 16/5, 25/8, 192/61, 427/136, 4352/1385, 12465/3968, 158720/50521, ...].
		

Crossrefs

Cf. triangle A008281 (main diagonal give zig-zag numbers A000111).

Programs

  • Mathematica
    e[n_] := If[EvenQ[n], Abs[EulerE[n]], Abs[(2^(n + 1)*(2^(n + 1) - 1)*BernoulliB[n + 1])/(n + 1)]]; r[n_] := 2*n*(e[n - 1]/e[n]); a[n_] := Denominator[r[n]]; Table[a[n], {n, 1, 23}] (* Jean-François Alcover, Mar 26 2013 *)
  • Python
    from itertools import count, islice, accumulate
    from fractions import Fraction
    def A132050_gen(): # generator of terms
        yield 1
        blist = (0,1)
        for n in count(2):
            yield Fraction(2*n*blist[-1],(blist:=tuple(accumulate(reversed(blist),initial=0)))[-1]).denominator
    A132050_list = list(islice(A132050_gen(),40)) # Chai Wah Wu, Jun 09-11 2022

Formula

a(n)=denominator(r(n)) with the rationals r(n):=2*n*e(n-1)/e(n) where e(n):=A000111(n).

Extensions

Definition made more explicit, and initial terms a(1)=a(2)=1 added by M. F. Hasler, Apr 03 2013

A185414 Square array, read by antidiagonals, used to recursively calculate the zigzag numbers A000111.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 5, 5, 3, 1, 16, 16, 10, 4, 1, 61, 61, 39, 17, 5, 1, 272, 272, 176, 80, 26, 6, 1, 1385, 1385, 903, 421, 145, 37, 7, 1, 7936, 7936, 5200, 2464, 880, 240, 50, 8, 1, 50521, 50521, 33219, 15917, 5825, 1661, 371, 65, 9, 1
Offset: 1

Author

Peter Bala, Jan 26 2011

Keywords

Comments

The table entries T(n,k), for n,k>=1, are defined by means of the recurrence relation (1)... T(n+1,k) = 1/2*{(k-1)*T(n,k-1)+(k+1)*T(n,k+1)}, with boundary condition T(1,k) = 1.
The first column of the table produces the sequence of zigzag numbers A000111. Cf. A185416, A185418 and A185420.
Diagonal T(n,n+1) = A290579(n) for n>=1. - Paul D. Hanna, Aug 07 2017

Examples

			The array begins:
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...;
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...;
2, 5, 10, 17, 26, 37, 50, 65, 82, ...;
5, 16, 39, 80, 145, 240, 371, 544, 765, ...;
16, 61, 176, 421, 880, 1661, 2896, 4741, 7376, ...;
61, 272, 903, 2464, 5825, 12336, 23947, 43328, 73989, ...;
272, 1385, 5200, 15917, 41936, 98377, 210320, 416765, ...;
1385, 7936, 33219, 112640, 326965, 840960, 1962191, ...; ...
Examples of the recurrence:
T(4,4) = 80 = (3*T(3,3) + 5*T(3,5))/2 = (3*10 + 5*26)/2;
T(5,3) = 176 = (2*T(4,2) + 4*T(4,4))/2 = (2*16 + 4*80)/2;
T(6,2) = 272 = (1*T(5,1) + 3*T(5,3))/2 = (1*16 + 3*176)/2.
		

Programs

  • Maple
    #A185414 Z := proc(n,x)
    description 'zigzag polynomials A147309'
    if n = 0 return 1 else return 1/2*x*(Z(n-1,x-1)+Z(n-1,x+1))
    end proc:
    # values of Z(n,x)/x
    for n from 1 to 10 do seq(Z(n,k)/k, k = 1..10);
    end do;
  • PARI
    {T(n,k)=if(n==1,1,((k-1)*T(n-1,k-1)+(k+1)*T(n-1,k+1))/2)}
    for(n=1,10, for(k=1,10, print1(T(n,k),", ")); print(""))

Formula

(1)... T(n,k) = Z(n,k)/k with Z(n,x) the zigzag polynomials described in A147309.

A185424 Numerators of generalized Bernoulli numbers associated with the zigzag numbers A000111.

Original entry on oeis.org

1, -1, 1, -1, 19, -5, 253, -61, 3319, -1385, 222557, -50521, 422152729, -2702765, 59833795, -199360981, 439264083023, -19391512145, 76632373664299, -2404879675441, 4432283799315809, -370371188237525
Offset: 0

Author

Peter Bala, Feb 18 2011

Keywords

Comments

DEFINITION
Let E(t) = sec(t)+tan(t) denote the generating function for the zigzag numbers A000111. The zigzag Bernoulli numbers, denoted ZB(n), are defined by means of the generating function
(1)... log E(t)/(E(t)-1) = sum {n = 0..inf} ZB(n)*t^n/n!.
Notice that if we were to take E(t) equal to exp(t) then (1) would be the defining function for the classical Bernoulli numbers B_n. The first few even-indexed values of ZB(n) are
....n..|..0...2.....4.......6........8..........10...........12....
===================================================================
.ZB(n).|..1..1/6..19/30..253/42..3319/30..222557/66..422152729/2730
while the odd-indexed values begin
....n..|. ..1......3......5.......7........9.........11..
=========================================================
.ZB(n).|. -1/2...-1/2...-5/2...-61/2...-1385/2...-50521/2
The present sequence gives the numerators of the zigzag Bernoulli numbers. It is not difficult to show that the odd-indexed value ZB(2*n+1) equals -1/2*A000364(n). The numerators of the even-indexed values ZB(2*n) are shown separately in A185425.
VON STAUDT-CLAUSEN THEOREM
The following analog of the von Staudt-Clausen theorem holds:
(2)... ZB(2*n) + 1/2 + S(1) + (-1)^(n+1)*S(3) equals an integer, where
... S(1) = sum {prime p, p = 1 (mod 4), p-1|2*n} 1/p,
... S(3) = sum {prime p, p = 3 (mod 4), p-1|2*n} 1/p.
For example,
(3)... ZB(12) + 1/2 + (1/5+1/13) - (1/3+1/7) = 154635.
Further examples are given below.

Examples

			Examples of von Staudt and Clausen's theorem for ZB(2*n):
ZB(2) = 1/6 = 1 - 1/2 - 1/3;
ZB(4) = 19/30 = 1 - 1/2 + 1/3 - 1/5;
ZB(6) = 253/42 = 7 - 1/2 - 1/3 - 1/7;
ZB(8) = 3319/30 = 111 - 1/2 + 1/3 - 1/5;
ZB(10) = 222557/66 = 3373 - 1/2 - 1/3 - 1/11.
		

Crossrefs

Sequence of denominators is A141056.

Programs

  • Maple
    #A185424
    a:= n-> numer((-1)^(n*(n-1)/2)*add(binomial(n,k)/(k+1)* bernoulli(n-k) *euler(k), k = 0..n)):
    seq(a(n), n = 0..20);
  • Mathematica
    Numerator[ Range[0, 30]! CoefficientList[ Series[Log(Sec[x]+Tan[x])/(Sec[x] +Tan[x] - 1), {x, 0, 30}], x]]

Formula

SEQUENCE ENTRIES
a(n) = numerator of the rational number ZB(n) where
(1)... ZB(n) = (-1)^(n*(n-1)/2)*sum {k = 0..n} binomial(n,k)/(k+1)* Bernoulli(n- k)*Euler(k).
For odd indices this simplifies to
(2)... ZB(2*n+1) = (-1)^n*Euler(2*n)/2, where Euler(2*n) = A028296(n).
For even indices we have
(3)... ZB(2*n) = (-1)^n*sum {k = 0..n} binomial(2*n,2*k)/(2*k+1)* Bernoulli(2*n- 2*k)*Euler(2*k).
GENERATING FUNCTION
E.g.f:
(4)... log(sec(t)+tan(t))/(sec(t)+tan(t)-1) =
1 -1/2*t +1/6*t^2/2! -1/2*t^3/3! + ....
RELATION WITH ZIGZAG POLYNOMIALS OF A147309
The classical Bernoulli numbers B_n are given by the double sum
(5)... B_n = sum {k=0..n} sum {j=0..k} (-1)^j*binomial(k,j)*j^n/(k+1).
The corresponding formula for the zigzag Bernoulli numbers is
(6)... ZB(n) = sum {k=0..n} sum {j=0..k}(-1)^j*binomial(k,j)*Z(n,j)/(k+1), where Z(n,x) is a zigzag polynomial as defined in A147309. Umbrally, we can express this as
(7)... ZB(n) = Z(n,B), where on the lhs the understanding is that in the expansion of the zigzag polynomial Z(n,x) a term such as c_k*x^k is to be replaced with c_k*B_k. For example, Z(6,x) = 40*x^2+20*x^4+x^6 and so ZB(6) = 40*B_2+20*B_4+B_6 = 40*(1/6)+20*(-1/30)+(1/42) = 253/42.

A247453 T(n,k) = binomial(n,k)*A000111(n-k)*(-1)^(n-k), 0 <= k <= n.

Original entry on oeis.org

1, -1, 1, 1, -2, 1, -2, 3, -3, 1, 5, -8, 6, -4, 1, -16, 25, -20, 10, -5, 1, 61, -96, 75, -40, 15, -6, 1, -272, 427, -336, 175, -70, 21, -7, 1, 1385, -2176, 1708, -896, 350, -112, 28, -8, 1, -7936, 12465, -9792, 5124, -2016, 630, -168, 36, -9, 1, 50521
Offset: 0

Author

Reinhard Zumkeller, Sep 17 2014

Keywords

Comments

Matrix inverse of A109449, the unsigned version of this sequence. More precisely, consider both of these triangles as the nonzero lower left of an infinite square array / matrix, filled with zeros above/right of the diagonal. Then these are mutually inverse of each other; in matrix notation: A247453 . A109449 = A109449 . A247453 = Identity matrix. In more conventional notation, for any m,n >= 0, Sum_{k=0..n} A247453(n,k)*A109449(k,m) = Sum_{k=0..n} A109449(n,k)*A247453(k,m) = delta(m,n), the Kronecker delta (= 1 if m = n, 0 else). - M. F. Hasler, Oct 06 2017

Examples

			.   0:      1
.   1:     -1      1
.   2:      1     -2      1
.   3:     -2      3     -3      1
.   4:      5     -8      6     -4      1
.   5:    -16     25    -20     10     -5     1
.   6:     61    -96     75    -40     15    -6     1
.   7:   -272    427   -336    175    -70    21    -7    1
.   8:   1385  -2176   1708   -896    350  -112    28   -8   1
.   9:  -7936  12465  -9792   5124  -2016   630  -168   36  -9   1
.  10:  50521 -79360  62325 -32640  12810 -4032  1050 -240  45 -10  1  .
		

Crossrefs

Programs

  • Haskell
    a247453 n k = a247453_tabl !! n !! k
    a247453_row n = a247453_tabl !! n
    a247453_tabl = zipWith (zipWith (*)) a109449_tabl a097807_tabl
    
  • Mathematica
    a111[n_] := n! SeriesCoefficient[(1+Sin[x])/Cos[x], {x, 0, n}];
    T[n_, k_] := (-1)^(n-k) Binomial[n, k] a111[n-k];
    Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Aug 03 2018 *)
  • PARI
    A247453(n,k)=(-1)^(n-k)*binomial(n,k)*if(n>k, 2*abs(polylog(k-n, I)), 1) \\ M. F. Hasler, Oct 06 2017

Formula

T(n,k) = (-1)^(n-k) * A007318(n,k) * A000111(n-k), k = 0..n;
T(n,k) = (-1)^(n-k) * A109449(n,k); A109449(n,k) = abs(T(n,k));
abs(sum of row n) = A062162(n);
Sum_{k=0..n} T(n,k)*A000111(k) = 0^n.

Extensions

Edited by M. F. Hasler, Oct 06 2017

A024255 a(0)=0, a(n) = n*E(2n-1) for n >= 1, where E(n) = A000111(n) are the Euler (or up-down) numbers.

Original entry on oeis.org

0, 1, 4, 48, 1088, 39680, 2122752, 156577792, 15230058496, 1888788086784, 290888851128320, 54466478584365056, 12185086638082228224, 3209979242472703787008, 983522422455215438430208, 346787762817143967622103040, 139423404114002708738732982272
Offset: 0

Author

Keywords

Comments

Number of cyclically alternating permutations of length 2n. Example: a(2)=4 because we have 1324, 1423, 2314, and 2413 (3412 is alternating but not cyclically alternating).

Crossrefs

Programs

  • Maple
    a := n -> (-1)^n*2^(2*n-1)*(1-2^(2*n))*bernoulli(2*n); # Peter Luschny, Jun 08 2009
  • Mathematica
    nn = 30; t = Range[0, nn]! CoefficientList[Series[Tan[x]*x/2, {x, 0, nn}], x]; Take[t, {1, nn, 2}]
    Table[(-1)^n 2 n PolyLog[1 - 2 n, -I], {n, 0, 19}] (* Peter Luschny, Aug 17 2021 *)
  • Python
    from itertools import accumulate, islice, count
    def A024255_gen(): # generator of terms
        yield from (0,1)
        blist = (0,1)
        for n in count(2):
            yield n*(blist := tuple(accumulate(reversed(tuple(accumulate(reversed(blist),initial=0))),initial=0)))[-1]
    A024255_list = list(islice(A024255_gen(),40)) # Chai Wah Wu, Jun 09-11 2022

Formula

a(n) = 2^(n-1)*(2^n-1)*|B_n|.
E.g.f.: tan(x)*x/2 (even part).
a(n) = (2*n)!*Pi^(-2*n)*(4^n-1)*Li{2*n}(1) for n > 0. - Peter Luschny, Jun 29 2012
G.f.: Q(0)*x/(1-4*x), where Q(k) = 1 - 16*x^2*(k+2)*(k+1)^3/( 16*x^2*(k+2)*(k+1)^3 - (1 - 8*x*k^2 - 12*x*k -4*x)*(1 - 8*x*k^2 - 28*x*k -24*x)/Q(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Oct 23 2013
a(n) = A009752(n)/2. - Alois P. Heinz, Aug 17 2021
a(n) = (-1)^n*2*n*PolyLog(1 - 2*n, -i). - Peter Luschny, Aug 17 2021

Extensions

Edited by Emeric Deutsch, Jul 01 2009
Showing 1-10 of 349 results. Next