login
Triangle read by rows. T(n, k) = [x^k] (2 - Sum_{k=0..n} binomial(n, k)*Euler(k, 1)*(-2*x)^k).
4

%I #46 Nov 17 2024 08:51:27

%S 1,1,1,1,2,0,1,3,0,-2,1,4,0,-8,0,1,5,0,-20,0,16,1,6,0,-40,0,96,0,1,7,

%T 0,-70,0,336,0,-272,1,8,0,-112,0,896,0,-2176,0,1,9,0,-168,0,2016,0,

%U -9792,0,7936,1,10,0,-240,0,4032,0,-32640,0,79360,0

%N Triangle read by rows. T(n, k) = [x^k] (2 - Sum_{k=0..n} binomial(n, k)*Euler(k, 1)*(-2*x)^k).

%C The Swiss-Knife polynomials (A081658 and A153641) generate the dual triangle ('dual' in the sense of Euler-tangent versus Euler-secant numbers).

%H Peter Luschny, <a href="/A363393/a363393.pdf">Illustrating the polynomials P363393</a>.

%H Peter Luschny, <a href="http://www.oeis.org/wiki/User:Peter_Luschny/SwissKnifePolynomials">Swiss-Knife polynomials and Euler numbers</a>.

%H Peter Luschny, <a href="http://www.luschny.de/math/seq/SwissKnifePolynomials.html">The Swiss-Knife polynomials</a>.

%H <a href="/index/Eu#Euler">Index entries for sequences related to Euler numbers.</a>

%F For a recursion see the Python program.

%F T(n, k) = [x^k] P(n, x) where P(n, x) = (1 / (n + 1)) * Sum_{j=0..n+1} binomial(n + 1, j) * Bernoulli(j, 1) * (4^j - 2^j) * x^(j - 1).

%F Integral_{x=-n..n} P(n, x)/2 dx = n.

%F T(n, k) = [x^(n - k)] -(-2)^k * Euler(k, 1) / (x - 1)^(k + 1).

%F T(n, k) = n! * [x^(n - k)][y^n] exp(x*y) * (1 + tanh(y)).

%e The triangle T(n, k) starts:

%e [0] 1;

%e [1] 1, 1;

%e [2] 1, 2, 0;

%e [3] 1, 3, 0, -2;

%e [4] 1, 4, 0, -8, 0;

%e [5] 1, 5, 0, -20, 0, 16;

%e [6] 1, 6, 0, -40, 0, 96, 0;

%e [7] 1, 7, 0, -70, 0, 336, 0, -272;

%e [8] 1, 8, 0, -112, 0, 896, 0, -2176, 0;

%e [9] 1, 9, 0, -168, 0, 2016, 0, -9792, 0, 7936;

%p P := n -> add(binomial(n + 1, j)*bernoulli(j, 1)*(4^j - 2^j)*x^(j-1), j = 0..n+1) / (n + 1): T := (n, k) -> coeff(P(n), x, k):

%p seq(seq(T(n, k), k = 0..n), n = 0..9);

%p # Second program, based on the generating functions of the columns:

%p ogf := n -> -(-2)^n * euler(n, 1) / (x - 1)^(n + 1):

%p ser := n -> series(ogf(n), x, 16):

%p T := (n, k) -> coeff(ser(k), x, n - k):

%p for n from 0 to 9 do seq(T(n, k), k = 0..n) od;

%p # Alternative, based on the bivariate generating function:

%p egf := exp(x*y) * (1 + tanh(y)): ord := 20:

%p sery := series(egf, y, ord): polx := n -> coeff(sery, y, n):

%p coefx := n -> seq(n! * coeff(polx(n), x, n - k), k = 0..n):

%p for n from 0 to 9 do coefx(n) od;

%o (SageMath)

%o def B(n: int):

%o return bernoulli_polynomial(1, n)

%o def P(n: int):

%o return sum(binomial(n + 1, j) * B(j) * (4^j - 2^j) * x^(j - 1)

%o for j in range(n + 2)) / (n + 1)

%o for n in range(10): print(P(n).list())

%o (Python)

%o from functools import cache

%o @cache

%o def T(n: int, k: int) -> int:

%o if k == 0: return 1

%o if k % 2 == 0: return 0

%o if k == n: return 1 - sum(T(n, j) for j in range(1, n, 2))

%o return (T(n - 1, k) * n) // (n - k)

%o for n in range(10): print([T(n, k) for k in range(n + 1)])

%Y Cf. A122045 (alternating row sums), A119880 (row sums), A214447 (central column), A155585 (main diagonal), A109573 (subdiagonal), A162660 (variant), A000364.

%Y Cf. A081658, A153641, A220901, A318254, A346838.

%K sign,tabl,changed

%O 0,5

%A _Peter Luschny_, Jun 04 2023

%E Simpler name by _Peter Luschny_, Nov 17 2024