cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-6 of 6 results.

A240559 a(n) = -2^n*(E(n, 1/2) + E(n, 1) + (n mod 2)*2*(E(n+1, 1/2) + E(n+1, 1))), where E(n, x) are the Euler polynomials.

Original entry on oeis.org

0, 0, 1, -3, -5, 45, 61, -1113, -1385, 42585, 50521, -2348973, -2702765, 176992725, 199360981, -17487754833, -19391512145, 2195014332465, 2404879675441, -341282303124693, -370371188237525, 64397376340013805, 69348874393137901, -14499110277050234553
Offset: 0

Views

Author

Peter Luschny, Apr 17 2014

Keywords

Examples

			G.f. = x^2 - 3*x^3 - 5*x^4 + 45*x^5 + 61*x^6 - 1113*x^7 - 1385*x^8 + ...
		

Crossrefs

Programs

  • Maple
    A240559 := proc(n) euler(n,1/2) + euler(n,1); if n mod 2 = 1 then % + 2*(euler(n+1,1/2)+euler(n+1,1)) fi; -2^n*% end: seq(A240559(n),n=0..19);
  • Mathematica
    skp[n_, x_] := Sum[Binomial[n, k]*EulerE[k]*x^(n-k), {k, 0, n}]; skp[n_, x0_?NumericQ] := skp[n, x] /. x -> x0; a[n_] := Sum[(-1)^(n-k)*Binomial[n, k]*(skp[k, 0] + skp[k+1, -1]), {k, 0, n}]; Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Dec 09 2014, after Peter Luschny *)
  • Sage
    # Efficient computation with L. Seidel's boustrophedon transformation.
    def A240559_list(n) :
        A = [0]*(n+1); A[0] = 1; R = [0]
        k = 0; e = 1; x = -1; s = -1
        for i in (0..n):
            Am = 0; A[k + e] = 0; e = -e;
            for j in (0..i): Am += A[k]; A[k] = Am; k += e
            if e == 1: x += 1; s = -s
            v = -A[-x] if e == 1 else A[-x] - A[x]
            if i > 1: R.append(s*v)
        return R
    A240559_list(24)

Formula

a(2*n) = (-1)^(n+1)*A147315(2*n,1) = (-1)^(n+1)*A186370(2*n,2*n) =(-1)^(n+1)*A000364(n) for n>0.
a(2*n+1) = (-1)^n*A147315(2*n+1,2) = (-1)^n*A186370(2*n,2*n-1) = A241242(n).
a(n) = Sum_{k=0..n} (-1)^(n-k)*2^k*binomial(n,k)*(E(k,1/2) + 2*E(k+1,0)) where E(n,x) are the Euler polynomials.
a(n) = Sum_{k=0..n} (-1)^(n-k)*binomial(n,k)*(skp(k,0) + skp(k+1,-1)), where skp(n, x) are the Swiss-Knife polynomials A153641.
a(n) = A239322(n) + A239005(n+1) - A239005(n). - Paul Curtz, Apr 18 2014
E.g.f.: 1 - sech(x) - tanh(x) + sinh(x)*sech(x)^2 = ((exp(-x)-1)*sech(x))^2 / 2. - Sergei N. Gladkovskii, Nov 20 2014
E.g.f.: (1 - sech(x)) * (1 - tanh(x)). - Michael Somos, Nov 22 2014

A291677 Number of permutations p of [2n] such that 0p has exactly n alternating runs.

Original entry on oeis.org

1, 1, 7, 148, 6171, 425976, 43979902, 6346283560, 1219725741715, 301190499710320, 92921064554444490, 35025128774218944648, 15838288022236083603486, 8462453158197423495502224, 5274234568391796228927038748, 3792391176672742840187796835728
Offset: 0

Views

Author

Alois P. Heinz, Aug 29 2017

Keywords

Examples

			a(2) = 7: 1243, 1342, 1432, 2341, 2431, 3421, 4321.
		

Crossrefs

Cf. A186370.
Bisection (even part) of A303160.

Programs

  • Maple
    b:= proc(n, k) option remember; `if`(k=0,
          `if`(n=0, 1, 0), `if`(k<0 or k>n, 0,
           k*b(n-1, k)+b(n-1, k-1)+(n-k+1)*b(n-1, k-2)))
        end:
    a:= n-> b(2*n, n):
    seq(a(n), n=0..20);
  • Mathematica
    b[n_, k_] := b[n, k] = If[k == 0, If[n == 0, 1, 0], If[k < 0 || k > n, 0, k*b[n - 1, k] + b[n - 1, k - 1] + (n - k + 1)*b[n - 1, k - 2]]];
    a[n_] := b[2*n, n]; Table[a[n], {n, 0, 20}] (* Jean-François Alcover, May 30 2019, after Alois P. Heinz *)
  • Python
    from sympy.core.cache import cacheit
    @cacheit
    def b(n, k): return (1 if n==0 else 0) if k==0 else 0 if k<0 or k>n else k*b(n - 1, k) + b(n - 1, k - 1) + (n - k + 1)*b(n - 1, k - 2)
    def a(n): return b(2*n, n)
    print([a(n) for n in range(31)]) # Indranil Ghosh, Aug 30 2017

Formula

a(n) = A186370(2n,n).
a(n) ~ c * d^n * n! * (n-1)!, where d = 3.4210546206711870249402157940795853513... and c = 0.32723781013647536133280275922604008889245... - Vaclav Kotesovec, Apr 29 2018

A303159 Number of permutations p of [2n+1] such that 0p has exactly n+1 alternating runs.

Original entry on oeis.org

1, 3, 43, 1344, 74211, 6384708, 789649750, 132789007200, 29145283614115, 8092186932120060, 2772830282722806978, 1149343084932146388144, 566844242187778610648334, 328043720353943611689811272, 220147053200818211779539712908, 169580070210721829547034445169024
Offset: 0

Views

Author

Alois P. Heinz, Apr 19 2018

Keywords

Examples

			a(1) = 3: 132, 231, 321.
		

Crossrefs

Bisection (odd part) of A303160.
Cf. A186370.

Programs

  • Maple
    b:= proc(n, k) option remember; `if`(k=0,
          `if`(n=0, 1, 0), `if`(k<0 or k>n, 0,
           k*b(n-1, k)+b(n-1, k-1)+(n-k+1)*b(n-1, k-2)))
        end:
    a:= n-> b(2*n+1, n+1):
    seq(a(n), n=0..20);
  • Mathematica
    b[n_, k_] := b[n, k] = If[k == 0,
        If[n == 0, 1, 0], If[k < 0 || k > n, 0,
        k b[n-1, k] + b[n-1, k-1] + (n-k+1) b[n-1, k-2]]];
    a[n_] := b[2n+1, n+1];
    a /@ Range[0, 20] (* Jean-François Alcover, Dec 21 2020, after Alois P. Heinz *)

Formula

a(n) = A186370(2n+1,n+1).
a(n) ~ c * d^n * n!^2, where d = 3.4210546206711870249402157940795853513031388... and c = 0.974460718185930534652526741942010711752... - Vaclav Kotesovec, Apr 29 2018

A303160 Number of permutations p of [n] such that 0p has exactly ceiling(n/2) alternating runs.

Original entry on oeis.org

1, 1, 1, 3, 7, 43, 148, 1344, 6171, 74211, 425976, 6384708, 43979902, 789649750, 6346283560, 132789007200, 1219725741715, 29145283614115, 301190499710320, 8092186932120060, 92921064554444490, 2772830282722806978, 35025128774218944648, 1149343084932146388144
Offset: 0

Views

Author

Alois P. Heinz, Apr 19 2018

Keywords

Examples

			a(2) = 1: 12.
a(3) = 3: 132, 231, 321.
a(4) = 7: 1243, 1342, 1432, 2341, 2431, 3421, 4321.
		

Crossrefs

Bisections give: A291677 (even part), A303159 (odd part).
Cf. A186370.

Programs

  • Maple
    b:= proc(n, k) option remember; `if`(k=0,
          `if`(n=0, 1, 0), `if`(k<0 or k>n, 0,
           k*b(n-1, k)+b(n-1, k-1)+(n-k+1)*b(n-1, k-2)))
        end:
    a:= n-> b(n, ceil(n/2)):
    seq(a(n), n=0..25);
  • Mathematica
    b[n_, k_] := b[n, k] = If[k == 0,
         If[n == 0, 1, 0], If[k < 0 || k > n, 0,
         k*b[n-1, k] + b[n-1, k-1] + (n-k+1)*b[n-1, k-2]]];
    a[n_] := b[n, Ceiling[n/2]];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Aug 31 2021, after Alois P. Heinz *)

Formula

a(n) = A186370(n,ceiling(n/2)).

A241242 a(n) = -2^(2*n+1)*(E(2*n+1, 1/2) + E(2*n+1, 1) + 2*(E(2*n+2, 1/2) + E(2*n+2, 1))), where E(n,x) are the Euler polynomials.

Original entry on oeis.org

0, -3, 45, -1113, 42585, -2348973, 176992725, -17487754833, 2195014332465, -341282303124693, 64397376340013805, -14499110277050234553, 3840151029102915908745, -1182008039799685905580413, 418424709061213506712209285, -168805428822414120140493978273
Offset: 0

Views

Author

Peter Luschny, Apr 17 2014

Keywords

Crossrefs

Programs

  • Maple
    A241242 := proc(n) e := n -> euler(n,1/2) + euler(n,1); -2^(2*n+1)*(e(2*n+1) + 2*e(2*n+2)) end: seq(A241242(n),n=0..15);
  • Mathematica
    Array[-2^(2 # + 1)*(EulerE[2 # + 1, 1/2] + EulerE[2 # + 1, 1] + 2 (EulerE[2 # + 2, 1/2] + EulerE[2 # + 2, 1])) &, 16, 0] (* Michael De Vlieger, May 24 2018 *)

Formula

a(n) = A240559(2*n+1) = (-1)^n*A147315(2*n+1,2) = (-1)^n*A186370(2*n,2*n-1).
a(n) = Sum_{k=0..2*n+1} (-1)^(2*n+1-k)*binomial(2*n+1, k)*2^k*(E(k, 1/2) + 2*E(k+1, 0)) where E(n,x) are the Euler polynomials.
a(n) = Sum_{k=0..2*n+1} (-1)^(2*n+1-k)*binomial(2*n+1, k)*(skp(k, 0) + skp(k+1, -1)), where skp(n, x) are the Swiss-Knife polynomials A153641.
a(n) = Bernoulli(2*n + 2) * 4^(n+1) * (1 - 4^(n+1)) / (2*n + 2) - EulerE(2*n + 2), where EulerE(2*n) is A028296. - Daniel Suteu, May 22 2018
a(n) = (-1)^(n+1) * (A000182(n+1) - A000364(n+1)). - Daniel Suteu, Jun 23 2018

A186371 Number of up-down runs in all permutations of {1,2,...,n}.

Original entry on oeis.org

0, 1, 3, 13, 68, 420, 3000, 24360, 221760, 2237760, 24796800, 299376000, 3911846400, 55005350400, 828193766400, 13294689408000, 226663557120000, 4090405423104000, 77895546753024000, 1561112121913344000, 32844177110384640000, 723788347432550400000
Offset: 0

Views

Author

Emeric Deutsch and Ira M. Gessel, Mar 01 2011

Keywords

Comments

The up-down runs of a permutation p are the alternating runs of the permutation p endowed with a 0 in the front. For example, 75814632 has 6 up-down runs: 07, 75, 58, 81, 146, and 632.

Examples

			a(3)=13 because the permutations 123, 132, 213, 231, 312, and 321 have a total of 1 + 2 + 3 + 2 + 3 + 2 = 13 up-down runs.
		

Crossrefs

Programs

  • Magma
    [0,1] cat [Factorial(n)*(4*n+1)/6: n in [2..30]]; // Vincenzo Librandi, Sep 11 2015
  • Maple
    0, 1, seq((1/6)*factorial(n)*(4*n+1), n = 2 .. 20);
  • Mathematica
    Join[{0, 1}, Table[n! (4 n + 1)/6, {n, 2, 20}]] (* Vincenzo Librandi, Sep 11 2015 *)

Formula

a(n) = Sum_{k=1..n} k*A186370(n,k).
a(n) = n!*(4n+1)/6 for n>=2.
E.g.f.: g(z) = z(6-3z+z^2)/[6(1-z)^2].
D-finite with recurrence 4*a(n) +(-4*n-7)*a(n-1) +3*(n-1)*a(n-2)=0. - R. J. Mathar, Jul 22 2022
Showing 1-6 of 6 results.