4 #include "base/cl_sysdep.h"
7 #include "cln/univpoly_integer.h"
12 #include "cln/integer.h"
16 const cl_UP_I tschebychev (sintL n)
18 // The Tschebychev polynomials (of the 1st kind) T_n(x) are defined
19 // through the recurrence relation
23 // T_{n+2}(x) = 2x T_{n+1}(x) - T_n(x) for n >= 0.
26 // T_n(x) satisfies the differential equation
27 // (x^2-1)*T_n''(x) + x*T_n'(x) - n^2*T_n(x) = 0.
29 // Proof: See elsewhere.
32 // The coefficients c_{n,k} of T_n(x) = sum(k=0..n, c_{n,k} x^k)
34 // c_{n,n} = 2^(n-1) for n>=1, 1 for n=0,
36 // c_{n,k} = (k+1)(k+2)/(k^2-n^2)*c_{n,k+2}
38 // It follows that for n>0
40 // T_n(x) = sum(j=0..floor(n/2), (-1)^j (n-j-1)!n/j!(n-2j)! 2^(n-2j-1) x^(n-2j))
42 var cl_univpoly_integer_ring R = find_univpoly_ring(cl_I_ring);
45 var cl_UP_I t = R->create(n);
47 var cl_I c_k = ash(1,n-1);
53 c_k = exquo((cl_I)(k+1) * (cl_I)(k+2) * c_k,
54 (cl_I)(k-n) * (cl_I)(k+n));