<?xml version="1.0" encoding="utf-8" standalone="no"?><?xml-stylesheet href="/mathmlc2p.xsl" type="text/xsl"?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>chebyshev</title>
</head>
<body>
<tt>
#<br/>
# jython examples for jas.<br/>
# $Id: chebyshev.py 4879 2014-08-23 20:27:43Z kredel $<br/>
#<br/>
<br/>
import sys;<br/>
<br/>
from jas import PolyRing, ZZ<br/>
from jas import startLog<br/>
<br/>
# chebyshev polynomial example<br/>
# T(0) = 1<br/>
# T(1) = x<br/>
# T(n) = 2 * x * T(n-1) - T(n-2)<br/>
<br/>
#r = Ring( &quot;Z(x) L&quot; );<br/>
r = PolyRing(ZZ(), &quot;(x)&quot;, PolyRing.lex );<br/>
print &quot;Ring: &quot; + str(r);<br/>
print;<br/>
<br/>
# sage like: with generators for the polynomial ring<br/>
#is automatic: [one,x] = r.gens();<br/>
<br/>
x2 = 2 * x;<br/>
<br/>
N = 10;<br/>
T = [one,x];<br/>
for n in range(2,N+1):<br/>
    t = x2 * T[n-1] - T[n-2];<br/>
    T.append( t );<br/>
<br/>
for n in range(0,N+1):<br/>
    print &quot;T[%s] = %s&quot; % (n,T[n]);<br/>
<br/>
print;<br/>
<br/>
#sys.exit();<br/>
</tt>
</body>
</html>
