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
x/cos(x) = x + 1/2*x^3 + 5/24*x^5 + 61/720*x^7 + 277/8064*x^9 + ...
- R. P. Brent, Generalising Tuenter's binomial sums, arXiv:1407.3533 [math.CO], 2014.
- R. B. Brent, Generalizing Tuenter's Binomial Sums, J. Int. Seq. 18 (2015) # 15.3.2.
- Sylvie Corteel, Alexander Lazar, and Anna Vanden Wyngaerd, Decorated square paths at q = -1, arXiv:2408.10640 [math.CO], 2024. See p. 3.
- Bishal Deb and Alan D. Sokal, Classical continued fractions for some multivariate polynomials generalizing the Genocchi and median Genocchi numbers, arXiv:2212.07232 [math.CO], 2022. See p. 12.
- Peter Luschny, The lost Bernoulli numbers.
- Wikipedia, Bernoulli Polynomials
-
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
-
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 *)
-
a(n)=(-1)^(n+1)*sum(i=0,2*n+1,binomial(2*n+1,i)*bernfrac(i)*4^i)
-
a(n)=subst(bernpol(2*n+1),'x,1/4)*4^(2*n+1)*(-1)^(n+1) \\ Charles R Greathouse IV, Dec 10 2014
-
# 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
A009752
Expansion of e.g.f. tan(x)*x (even powers only).
Original entry on oeis.org
0, 2, 8, 96, 2176, 79360, 4245504, 313155584, 30460116992, 3777576173568, 581777702256640, 108932957168730112, 24370173276164456448, 6419958484945407574016, 1967044844910430876860416, 693575525634287935244206080, 278846808228005417477465964544, 126799861926498005417315327279104
Offset: 0
2*x/(1+e^(2*x)) = 0 + x - 2/2!*x^2 + 8/4!*x^4 - 96/6!*x^6 + 2176/8!*x^8 ...
-
a := n -> 4^n*n*`if`(n=0,0,abs(euler(2*n-1, 0))): # Peter Luschny, Jun 09 2016
-
nn = 30; t = Range[0, nn]! CoefficientList[Series[x*Tan[x], {x, 0, nn}], x]; Take[t, {1, nn + 1, 2}] (* T. D. Noe, Sep 20 2012 *)
Table[(-1)^n 4 n PolyLog[1 - 2 n, -I], {n, 0, 19}] (* Peter Luschny, Aug 17 2021 *)
-
my(x='x+O('x^50)); v=Vec(serlaplace(x*tan(x))); concat([0], vector(#v\2,n,v[2*n-1])) \\ G. C. Greubel, Feb 12 2018
A249402
The number of 3-alternating permutations of [n].
Original entry on oeis.org
1, 1, 1, 2, 3, 11, 40, 99, 589, 3194, 11259, 92159, 666160, 3052323, 31799041, 287316122, 1620265923, 20497038755, 222237912664, 1488257158851, 22149498351205, 280180369563194, 2172534146099019, 37183508549366519, 537546603651987424, 4736552519729393091
Offset: 0
The a(4)=3 3-alternating permutations of [4] are: [2 1 3 4 ] [3 1 2 4 ] and [4 1 2 3 ].
The a(5)=11 3-alternating permutations of [5] are: [2 1 3 5 4 ] [2 1 4 5 3 ] [3 1 2 5 4 ] [3 1 4 5 2 ] [3 2 4 5 1 ] [4 1 2 5 3 ] [4 1 3 5 2 ] [4 2 3 5 1 ] [5 1 2 4 3 ] [5 1 3 4 2 ] and [5 2 3 4 1 ].
Cf.
A178963,
A249583 (alternative definitions of 3-alternating permutations).
-
b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
`if`(t=1, add(b(u-j, o+j-1, irem(t+1, 3)), j=1..u),
add(b(u+j-1, o-j, irem(t+1, 3)), j=1..o)))
end:
a:= n-> b(0, n, 0):
seq(a(n), n=0..35); # Alois P. Heinz, Oct 27 2014
-
b[u_, o_, t_] := b[u, o, t] = If[u+o == 0, 1, If[t == 1, Sum[b[u-j, o+j-1, Mod[t+1, 3]], {j, 1, u}], Sum[b[u+j-1, o-j, Mod[t+1, 3]], {j, 1, o}]]]; a[n_] := b[0, n, 0]; Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Jun 22 2015, after Alois P. Heinz *)
A104345
Triangle read by rows: T(n,k) is the number of alternating permutations on [n+1] with 1 in position k+1, 0<=k<=n.
Original entry on oeis.org
1, 1, 1, 1, 2, 1, 2, 3, 3, 2, 5, 8, 6, 8, 5, 16, 25, 20, 20, 25, 16, 61, 96, 75, 80, 75, 96, 61, 272, 427, 336, 350, 350, 336, 427, 272, 1385, 2176, 1708, 1792, 1750, 1792, 1708, 2176, 1385, 7936, 12465, 9792, 10248, 10080, 10080, 10248, 9792, 12465, 7936
Offset: 0
Table begins
\ k..0....1....2....3....4....
n
0 |..1
1 |..1....1
2 |..1....2....1
3 |..2....3....3....2
4 |..5....8....6....8....5
5 |.16...25...20...20...25...16
6 |.61...96...75...80...75...96...61
7 |272..427..336..350..350..336..427..272
For example, T(3,1) counts 2143, 3142, 4132 - the alternating permutations on [4] with 1 in position 2.
-
b:= proc(u, o) option remember; `if`(u+o=0, 1,
add(b(o-1+j, u-j), j=1..u))
end:
T:= (n, k)-> binomial(n, k)*b(k, 0)*b(n-k, 0):
seq(seq(T(n, k), k=0..n), n=0..10); # Alois P. Heinz, Apr 25 2023
-
b[u_, o_] := b[u, o] = If[u+o == 0, 1, Sum[b[o-1+j, u-j], {j, 1, u}]];
T[n_, k_] := Binomial[n, k]*b[k, 0]*b[n-k, 0];
Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}] // Flatten (* Jean-François Alcover, Apr 01 2024, after Alois P. Heinz *)
A099028
Euler-Seidel matrix T(k,n) with start sequence e.g.f. 2x/(1+e^(2x)), read by antidiagonals.
Original entry on oeis.org
0, 1, 1, 0, -1, -2, -3, -3, -2, 0, 0, 3, 6, 8, 8, 25, 25, 22, 16, 8, 0, 0, -25, -50, -72, -88, -96, -96, -427, -427, -402, -352, -280, -192, -96, 0, 0, 427, 854, 1256, 1608, 1888, 2080, 2176, 2176, 12465, 12465, 12038, 11184, 9928, 8320, 6432, 4352, 2176, 0
Offset: 0
Seidel matrix:
[ 0 1 -2 0 8 0 -96 0 2176 0]
[ 1 -1 -2 8 8 -96 -96 2176 2176 .]
[ 0 -3 6 16 -88 -192 2080 4352 . .]
[ -3 3 22 -72 -280 1888 6432 . . .]
[ 0 25 -50 -352 1608 8320 . . . .]
[ 25 -25 -402 1256 9928 . . . . .]
[ 0 -427 854 11184 . . . . . .]
[ -427 427 12038 . . . . . . .]
[ 0 12465 . . . . . . . .]
[12465 . . . . . . . . .]
-
T[k_, n_] := T[k, n] = If[k == 0, SeriesCoefficient[2x/(1 + E^(2x)), {x, 0, n}] n!, T[k-1, n] + T[k-1, n+1]];
Table[T[k-n, n], {k, 0, 9}, {n, 0, k}] (* Jean-François Alcover, Jun 11 2019 *)
-
def SeidelMatrixA099028(dim):
E = matrix(ZZ, dim)
t = taylor(2*x/(1+exp(2*x)), x, 0, dim + 1)
for k in (0..dim-1):
E[0, k] = factorial(k) * t.coefficient(x, k)
R = [0]
for n in (1..dim-1):
for k in (0..dim-n-1):
E[n, k] = E[n-1, k] + E[n-1, k+1]
R.extend([E[n-k,k] for k in (0..n)])
return R
print(SeidelMatrixA099028(10)) # Peter Luschny, Jul 02 2016
A178616
Triangle by columns, odd columns of Pascal's triangle A007318, otherwise (1, 0, 0, 0, ...).
Original entry on oeis.org
1, 0, 1, 0, 2, 1, 0, 3, 0, 1, 0, 4, 0, 4, 1, 0, 5, 0, 10, 0, 1, 0, 6, 0, 20, 0, 6, 1, 0, 7, 0, 35, 0, 21, 0, 1, 0, 8, 0, 56, 0, 56, 0, 8, 0, 1, 0, 9, 0, 84, 0, 126, 0, 36, 0, 1, 0, 10, 0, 120, 0, 252, 0, 120, 0, 10, 1
Offset: 0
First few rows of the triangle:
1,
0, 1;
0, 2, 1;
0, 3, 0, 1
0, 4, 0, 4, 1;
0, 5, 0, 10, 0, 1;
0, 6, 0, 20, 0, 6, 1;
0, 7, 0, 35, 0, 21, 0, 1;
0, 8, 0, 56, 0, 56, 0, 8, 1;
0, 9, 0, 84, 0, 126, 0, 36, 0, 1;
0, 10, 0, 120, 0, 252, 0, 120, 0, 10, 1;
0, 11, 0, 165, 0, 462, 0, 330, 0, 55, 0, 1;
...
A250259
The number of 4-alternating permutations of [n].
Original entry on oeis.org
1, 1, 1, 2, 3, 4, 19, 78, 217, 496, 3961, 25442, 105963, 349504, 3908059, 34227438, 190065457, 819786496, 11785687921, 130746521282, 907546301523, 4835447317504, 84965187064099, 1141012634368398, 9504085749177097, 60283564499562496, 1251854782837499881
Offset: 0
-
onestep := proc(n::integer,ups::integer,downs::integer,uplen::integer)
local thisstep,left,doup,tak,ret ;
option remember;
left := ups+downs ;
if left = 0 then
return 1;
end if;
thisstep := n-left+1 ;
if modp(thisstep-2,uplen+1) = 0 then
doup := false;
else
doup := true;
end if;
if doup then
ret := 0 ;
for tak from 1 to ups do
ret := ret+procname(n,ups-tak,downs+tak-1,uplen) ;
end do:
return ret ;
else
ret := 0 ;
for tak from 1 to downs do
ret := ret+procname(n,ups+tak-1,downs-tak,uplen) ;
end do:
return ret ;
end if;
end proc:
downupP := proc(n::integer,uplen::integer)
local ret,tak;
if n = 0 then
return 1;
end if;
ret := 0 ;
for tak from 1 to n do
ret := ret+onestep(n,n-tak,tak-1,uplen) ;
end do:
return ret ;
end proc:
A250259 :=proc(n)
downupP(n,3) ;
end proc:
seq(A250259(n),n=0..20) ; # R. J. Mathar, Nov 15 2014
# second Maple program:
b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
`if`(t=1, add(b(u-j, o+j-1, irem(t+1, 4)), j=1..u),
add(b(u+j-1, o-j, irem(t+1, 4)), j=1..o)))
end:
a:= n-> b(0, n, 0):
seq(a(n), n=0..35); # Alois P. Heinz, Nov 15 2014
-
b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, 1, If[t == 1, Sum[b[u - j, o + j - 1, Mod[t + 1, 4]], {j, 1, u}], Sum[b[u + j - 1, o - j, Mod[t + 1, 4]], {j, 1, o}]]]; a[n_] := b[0, n, 0]; Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Jul 10 2017, after Alois P. Heinz *)
A250260
The number of 5-alternating permutations of [n].
Original entry on oeis.org
1, 1, 1, 2, 3, 4, 5, 29, 133, 412, 1041, 2300, 22991, 170832, 822198, 3114489, 10006375, 141705439, 1457872978, 9522474417, 48094772656, 202808749375, 3716808948931, 48860589990687, 403131250565618, 2545098156762649, 13287626090593750
Offset: 0
-
# dowupP defined in A250259.
A250260 :=proc(n)
downupP(n,4) ;
end proc:
seq(A250260(n),n=0..20) ;
# second Maple program:
b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
`if`(t=1, add(b(u-j, o+j-1, irem(t+1, 5)), j=1..u),
add(b(u+j-1, o-j, irem(t+1, 5)), j=1..o)))
end:
a:= n-> b(0, n, 0):
seq(a(n), n=0..35); # Alois P. Heinz, Nov 15 2014
-
b[u_, o_, t_] := b[u, o, t] = If[u+o == 0, 1, If[t == 1, Sum[b[u-j, o+j-1, Mod[t+1, 5]], {j, 1, u}], Sum[b[u+j-1, o-j, Mod[t+1, 5]], {j, 1, o}]]]; a[n_] := b[0, n, 0]; Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Jun 24 2015, after Alois P. Heinz *)
A243963
a(n) = n*4^n*(-Z(1-n, 1/4)/2 + Z(1-n, 3/4)/2 - Z(1-n, 1)*(1 - 2^(-n))) for n > 0 and a(0) = 0, where Z(n, c) is the Hurwitz zeta function.
Original entry on oeis.org
0, 0, 2, 3, -8, -25, 96, 427, -2176, -12465, 79360, 555731, -4245504, -35135945, 313155584, 2990414715, -30460116992, -329655706465, 3777576173568, 45692713833379, -581777702256640, -7777794952988025, 108932957168730112, 1595024111042171723, -24370173276164456448
Offset: 0
-
a := n -> `if`(n=0, 0, n*4^n*(-Zeta(0, 1-n, 1/4)/2 + Zeta(0, 1-n, 3/4)/2 + Zeta(1-n)*(2^(-n)-1))): seq(a(n), n=0..24); # Peter Luschny, Jul 21 2020
-
a[0] = 0; a[n_] := -n*SeriesCoefficient[(2*E^x*(1 - E^x))/(1 + E^(2*x)), {x, 0, n-1}]*(n-1)!; Table[a[n], {n, 0, 21}] (* Jean-François Alcover, Jun 17 2014 *)
A294033
Triangle read by rows, expansion of exp(x*z)*z*(tanh(z) + sech(z)), T(n, k) for n >= 1 and 0 <= k <= n-1.
Original entry on oeis.org
1, 2, 2, -3, 6, 3, -8, -12, 12, 4, 25, -40, -30, 20, 5, 96, 150, -120, -60, 30, 6, -427, 672, 525, -280, -105, 42, 7, -2176, -3416, 2688, 1400, -560, -168, 56, 8, 12465, -19584, -15372, 8064, 3150, -1008, -252, 72, 9, 79360, 124650, -97920, -51240, 20160, 6300, -1680, -360, 90, 10, -555731, 872960, 685575, -359040, -140910, 44352, 11550, -2640, -495, 110, 11
Offset: 1
Triangle starts:
[1][ 1]
[2][ 2, 2]
[3][ -3, 6, 3]
[4][ -8, -12, 12, 4]
[5][ 25, -40, -30, 20, 5]
[6][ 96, 150, -120, -60, 30, 6]
[7][-427, 672, 525, -280, -105, 42, 7]
-
gf := exp(x*z)*z*(tanh(z)+sech(z)):
s := n -> n!*coeff(series(gf,z,n+2),z,n):
C := n -> PolynomialTools:-CoefficientList(s(n),x):
ListTools:-FlattenOnce([seq(C(n), n=1..7)]);
# Alternatively:
T := (n, k) -> `if`(n = k+1, n,
(k+1)*binomial(n,k+1)*2^(n-k-1)*(euler(n-k-1, 1/2)+euler(n-k-1, 1))):
for n from 1 to 7 do seq(T(n,k), k=0..n-1) od;
-
L[0] := 1; L[n_] := (-1)^Binomial[n, 2] 2 Abs[PolyLog[-n, -I]];
p[n_] := n Sum[Binomial[n - 1, k - 1] L[k - 1] x^(n - k), {k, 0, n}];
Table[CoefficientList[p[n], x], {n, 1, 11}] // Flatten
Showing 1-10 of 10 results.
Comments