login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

fricas
Z==>Integer; Q==>Fraction Z
Type: Void
fricas
z: Symbol := 'z; P==>UnivariatePolynomial(z,Q)
Type: Void
fricas
t:P := monomial(1,1)

\label{eq1}z(1)
Type: UnivariatePolynomial(z,Fraction(Integer))
fricas
p:P := (1-t)*(1-t^2)*(1-t^3)

\label{eq2}-{{z}^{6}}+{{z}^{5}}+{{z}^{4}}-{{z}^{2}}- z + 1(2)
Type: UnivariatePolynomial(z,Fraction(Integer))
fricas
L==>UnivariateLaurentSeries(Q,z,0)
Type: Void
fricas
R ==> Record(k: Z, c: Q)
Type: Void
fricas
l: List R := reverse [[degree m, leadingCoefficient m]$R for m in monomials p]

\label{eq3}\begin{array}{@{}l}
\displaystyle
\left[{\left[{k = 0}, \:{c = 1}\right]}, \:{\left[{k = 1}, \:{c = - 1}\right]}, \:{\left[{k = 2}, \:{c = - 1}\right]}, \: \right.
\
\
\displaystyle
\left.{\left[{k = 4}, \:{c = 1}\right]}, \:{\left[{k = 5}, \:{c = 1}\right]}, \:{\left[{k = 6}, \:{c = - 1}\right]}\right] 
(3)
Type: List(Record(k: Integer,c: Fraction(Integer)))
fricas
series(l)$L

\label{eq4}1 - z -{{z}^{2}}(4)
Type: UnivariateLaurentSeries?(Fraction(Integer),z,0)

fricas
l1: List R := [[n, if n=5 then 0 else n/1]$R for n in 1..7]

\label{eq5}\begin{array}{@{}l}
\displaystyle
\left[{\left[{k = 1}, \:{c = 1}\right]}, \:{\left[{k = 2}, \:{c = 2}\right]}, \:{\left[{k = 3}, \:{c = 3}\right]}, \:{\left[{k = 4}, \:{c = 4}\right]}, \: \right.
\
\
\displaystyle
\left.{\left[{k = 5}, \:{c = 0}\right]}, \:{\left[{k = 6}, \:{c = 6}\right]}, \:{\left[{k = 7}, \:{c = 7}\right]}\right] 
(5)
Type: List(Record(k: Integer,c: Fraction(Integer)))
fricas
series(l1)$L

\label{eq6}z +{2 \ {{z}^{2}}}+{3 \ {{z}^{3}}}+{4 \ {{z}^{4}}}+{6 \ {{z}^{6}}}+{7 \ {{z}^{7}}}(6)
Type: UnivariateLaurentSeries?(Fraction(Integer),z,0)

It seems weird that the resulting series is aborted at a non-existing coefficient in the input list.

fricas
l2: List R := [[n, n/1]$R for n in 1..7|n~=5]

\label{eq7}\begin{array}{@{}l}
\displaystyle
\left[{\left[{k = 1}, \:{c = 1}\right]}, \:{\left[{k = 2}, \:{c = 2}\right]}, \:{\left[{k = 3}, \:{c = 3}\right]}, \:{\left[{k = 4}, \:{c = 4}\right]}, \: \right.
\
\
\displaystyle
\left.{\left[{k = 6}, \:{c = 6}\right]}, \:{\left[{k = 7}, \:{c = 7}\right]}\right] 
(7)
Type: List(Record(k: Integer,c: Fraction(Integer)))
fricas
series(l2)$L

\label{eq8}z +{2 \ {{z}^{2}}}+{3 \ {{z}^{3}}}+{4 \ {{z}^{4}}}(8)
Type: UnivariateLaurentSeries?(Fraction(Integer),z,0)

There is obviously also a bug here, because the zero coefficient should have been removed. I would, however, accept such a result if the specification of series were made precise as to rely on the input stream not to contain zero coefficients.

fricas
S ==> SparseUnivariateLaurentSeries(Q,z,0)
Type: Void
fricas
series(l)$S

\label{eq9}1 - z -{{z}^{2}}+{{z}^{4}}+{{z}^{5}}-{{z}^{6}}(9)
Type: SparseUnivariateLaurentSeries?(Fraction(Integer),z,0)
fricas
series(l1)$S

\label{eq10}z +{2 \ {{z}^{2}}}+{3 \ {{z}^{3}}}+{4 \ {{z}^{4}}}+{0 \ {{z}^{5}}}+{6 \ {{z}^{6}}}+{7 \ {{z}^{7}}}(10)
Type: SparseUnivariateLaurentSeries?(Fraction(Integer),z,0)
fricas
series(l2)$S

\label{eq11}z +{2 \ {{z}^{2}}}+{3 \ {{z}^{3}}}+{4 \ {{z}^{4}}}+{6 \ {{z}^{6}}}+{7 \ {{z}^{7}}}(11)
Type: SparseUnivariateLaurentSeries?(Fraction(Integer),z,0)




  Subject:   Be Bold !!
  ( 12 subscribers )  
Please rate this page: