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

spad
)abbrev package SUMMPACK SummPack
SummPack(): Exports == Implementation where
  FPI ==> Fraction Polynomial Integer
  X ==> Expression Integer
  NNI ==> NonNegativeInteger
  PI ==> PositiveInteger
  POLINT ==> Polynomial Integer 
  BOP ==> BasicOperator
Exports == with coeffMatrix : (PI,PI) -> Matrix X funcMatrix : ((X,X)->X,PI,PI) -> Matrix X sumAndNormalize : (Matrix X,Matrix X) -> X retractNumeratorToPolyInt : X -> Polynomial Integer findCoeffs : (POLINT,Matrix X, Symbol) -> List Equation FPI formalExpr : (BOP,Matrix X,PI,PI) -> X celine : ((X,X)->X,PI,PI) -> X celine2 : ((X,X)->X,BOP,PI,PI) -> X
Implementation == add
coeffMatrix(I:PI,J:PI):Matrix X == matrix [[new()$Symbol::X for i in 0..I] for j in 0..J]
funcMatrix(F:(X,X)->X,I:PI,J:PI):Matrix X == n:X:='n::X k:X:='k::X matrix [[F(n-j::X,k-i::X)/F(n,k) for i in 0..I] for j in 0..J]
sumAndNormalize(CM:Matrix X, FM:Matrix X):X == n:=nrows(CM) t:X:=trace(squareMatrix(CM*transpose(FM))$SquareMatrix(n,X)) normalize(t)$ElementaryFunctionStructurePackage(Integer,X)
retractNumeratorToPolyInt(san:X):Polynomial Integer == p:Polynomial Integer:=retract(numerator san) return p
findCoeffs(p:POLINT,m:Matrix X,k:Symbol):List Equation FPI == d:=degree(p,k) eqs:List Equation FPI:=[coefficient(p,k,l)::FPI=0 for l in 0..d] v:=members m x:=variables v sol:=solve(eqs,x)$SystemSolvePackage(Integer) --$TransSolvePackage(Integer) first sol
convToFPI(M:Matrix X):Matrix FPI == m:=copy(M) nr:=nrows(m) nc:=ncols(m) r:=zero(nr,nc)$Matrix(FPI) for i in 1..nr repeat for j in 1..nc repeat r(i,j):=retract m(i,j) return r
formalExpr(op:BOP,cm:Matrix X,I:PI,J:PI):X == d:=nrows(cm) n:X:='n::X k:X:='k::X g:Matrix(X):=matrix [[op(n-j::X,k-i::X) for i in 0..I] for j in 0..J] t:X:=trace(squareMatrix(cm*transpose(g))$SquareMatrix(d,X)) return t
celine(F:(X,X)->X,I:PI,J:PI):X == cm:Matrix X:=coeffMatrix(I,J) fm:=funcMatrix(F,I,J) san:=sumAndNormalize(cm,fm) p:=retractNumeratorToPolyInt(san) -- seq:=findCoeffs(p,cm,'k) e:List Equation X:=[lhs(x)::X=rhs(x)::X for x in seq] G:=operator 'G fex:X:=formalExpr(G,cm,I,J) subst(fex,e)
celine2(F:(X,X)->X,op:BOP,I:PI,J:PI):X == cm:Matrix X:=coeffMatrix(I,J) fm:=funcMatrix(F,I,J) san:=sumAndNormalize(cm,fm) p:=retractNumeratorToPolyInt(san) -- seq:=findCoeffs(p,cm,'k) e:List Equation X:=[lhs(x)::X=rhs(x)::X for x in seq] fex:X:=formalExpr(op,cm,I,J) subst(fex,e)
-- C:=celine2((k,n)+->binomial(n,k),operator 'T,1,1) -- variables(%) -- C=0 ; %/?% -- sum(C,k=1..n), tower(C), kernels(C), variables C, mainKernel C
spad
   Compiling FriCAS source code from file 
      /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/4749327676615086707-25px001.spad
      using old system compiler.
   SUMMPACK abbreviates package SummPack 
------------------------------------------------------------------------
   initializing NRLIB SUMMPACK for SummPack 
   compiling into NRLIB SUMMPACK 
   compiling exported coeffMatrix : (PositiveInteger,PositiveInteger) -> Matrix Expression Integer
Time: 0.06 SEC.
compiling exported funcMatrix : ((Expression Integer,Expression Integer) -> Expression Integer,PositiveInteger,PositiveInteger) -> Matrix Expression Integer Time: 0.03 SEC.
compiling exported sumAndNormalize : (Matrix Expression Integer,Matrix Expression Integer) -> Expression Integer Time: 0.05 SEC.
compiling exported retractNumeratorToPolyInt : Expression Integer -> Polynomial Integer Time: 0 SEC.
compiling exported findCoeffs : (Polynomial Integer,Matrix Expression Integer,Symbol) -> List Equation Fraction Polynomial Integer Time: 0.04 SEC.
compiling local convToFPI : Matrix Expression Integer -> Matrix Fraction Polynomial Integer Time: 0.02 SEC.
compiling exported formalExpr : (BasicOperator,Matrix Expression Integer,PositiveInteger,PositiveInteger) -> Expression Integer Time: 0.03 SEC.
compiling exported celine : ((Expression Integer,Expression Integer) -> Expression Integer,PositiveInteger,PositiveInteger) -> Expression Integer Time: 0.02 SEC.
compiling exported celine2 : ((Expression Integer,Expression Integer) -> Expression Integer,BasicOperator,PositiveInteger,PositiveInteger) -> Expression Integer Time: 0.01 SEC.
(time taken in buildFunctor: 0)
;;; *** |SummPack| REDEFINED
;;; *** |SummPack| REDEFINED Time: 0 SEC.
Warnings: [1] sumAndNormalize: not known that (AlgebraicallyClosedField) is of mode (CATEGORY domain (IF (has (Integer) (IntegralDomain)) (PROGN (ATTRIBUTE (AlgebraicallyClosedFunctionSpace (Integer))) (ATTRIBUTE (TranscendentalFunctionCategory)) (ATTRIBUTE (CombinatorialOpsCategory)) (ATTRIBUTE (LiouvillianFunctionCategory)) (ATTRIBUTE (SpecialFunctionCategory)) (SIGNATURE reduce ($ $)) (SIGNATURE number? ((Boolean) $)) (IF (has (Integer) (PolynomialFactorizationExplicit)) (ATTRIBUTE (PolynomialFactorizationExplicit)) noBranch) (SIGNATURE setSimplifyDenomsFlag ((Boolean) (Boolean))) (SIGNATURE getSimplifyDenomsFlag ((Boolean)))) noBranch)) [2] sumAndNormalize: not known that (TranscendentalFunctionCategory) is of mode (CATEGORY domain (IF (has (Integer) (IntegralDomain)) (PROGN (ATTRIBUTE (AlgebraicallyClosedFunctionSpace (Integer))) (ATTRIBUTE (TranscendentalFunctionCategory)) (ATTRIBUTE (CombinatorialOpsCategory)) (ATTRIBUTE (LiouvillianFunctionCategory)) (ATTRIBUTE (SpecialFunctionCategory)) (SIGNATURE reduce ($ $)) (SIGNATURE number? ((Boolean) $)) (IF (has (Integer) (PolynomialFactorizationExplicit)) (ATTRIBUTE (PolynomialFactorizationExplicit)) noBranch) (SIGNATURE setSimplifyDenomsFlag ((Boolean) (Boolean))) (SIGNATURE getSimplifyDenomsFlag ((Boolean)))) noBranch))
Cumulative Statistics for Constructor SummPack Time: 0.26 seconds
finalizing NRLIB SUMMPACK Processing SummPack for Browser database: --->-->SummPack(constructor): Not documented!!!! --->-->SummPack((coeffMatrix ((Matrix (Expression (Integer))) (PositiveInteger) (PositiveInteger)))): Not documented!!!! --->-->SummPack((funcMatrix ((Matrix (Expression (Integer))) (Mapping (Expression (Integer)) (Expression (Integer)) (Expression (Integer))) (PositiveInteger) (PositiveInteger)))): Not documented!!!! --->-->SummPack((sumAndNormalize ((Expression (Integer)) (Matrix (Expression (Integer))) (Matrix (Expression (Integer)))))): Not documented!!!! --->-->SummPack((retractNumeratorToPolyInt ((Polynomial (Integer)) (Expression (Integer))))): Not documented!!!! --->-->SummPack((findCoeffs ((List (Equation (Fraction (Polynomial (Integer))))) (Polynomial (Integer)) (Matrix (Expression (Integer))) (Symbol)))): Not documented!!!! --->-->SummPack((formalExpr ((Expression (Integer)) (BasicOperator) (Matrix (Expression (Integer))) (PositiveInteger) (PositiveInteger)))): Not documented!!!! --->-->SummPack((celine ((Expression (Integer)) (Mapping (Expression (Integer)) (Expression (Integer)) (Expression (Integer))) (PositiveInteger) (PositiveInteger)))): Not documented!!!! --->-->SummPack((celine2 ((Expression (Integer)) (Mapping (Expression (Integer)) (Expression (Integer)) (Expression (Integer))) (BasicOperator) (PositiveInteger) (PositiveInteger)))): Not documented!!!! --->-->SummPack(): Missing Description ; compiling file "/var/aw/var/LatexWiki/SUMMPACK.NRLIB/SUMMPACK.lsp" (written 16 JUL 2018 07:31:44 PM):
; /var/aw/var/LatexWiki/SUMMPACK.NRLIB/SUMMPACK.fasl written ; compilation finished in 0:00:00.079 ------------------------------------------------------------------------ SummPack is now explicitly exposed in frame initial SummPack will be automatically loaded when needed from /var/aw/var/LatexWiki/SUMMPACK.NRLIB/SUMMPACK

Test different flavours

fricas
--)co sumpack
X==>EXPR INT
Type: Void
fricas
F:=(n:X,k:X):X+->k*binomial(n,k)

\label{eq1}\mbox{theMap (...)}(1)
Type: ((Expression(Integer), Expression(Integer)) -> Expression(Integer))
fricas
cm:=coeffMatrix(1,1)

\label{eq2}\left[ 
\begin{array}{cc}
\%A & \%B 
\
\%C & \%D 
(2)
Type: Matrix(Expression(Integer))
fricas
fm:=funcMatrix(F,1,1)

\label{eq3}\left[ 
\begin{array}{cc}
1 &{{{\left(k - 1 \right)}\ {\hbox{\axiomType{BINOMIAL}\ } \left({n , \:{k - 1}}\right)}}\over{k \ {\hbox{\axiomType{BINOMIAL}\ } \left({n , \: k}\right)}}}
\
{{\hbox{\axiomType{BINOMIAL}\ } \left({{n - 1}, \: k}\right)}\over{\hbox{\axiomType{BINOMIAL}\ } \left({n , \: k}\right)}}&{{{\left(k - 1 \right)}\ {\hbox{\axiomType{BINOMIAL}\ } \left({{n - 1}, \:{k - 1}}\right)}}\over{k \ {\hbox{\axiomType{BINOMIAL}\ } \left({n , \: k}\right)}}}
(3)
Type: Matrix(Expression(Integer))
fricas
san:=sumAndNormalize(cm,fm)

\label{eq4}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left(\%C + \%A \right)}\ {{n}^{2}}}+{{\left({
\begin{array}{@{}l}
\displaystyle
{{\left({
\begin{array}{@{}l}
\displaystyle
\%D -{2 \  \%C}+ \%B - 
\
\
\displaystyle
\%A 
(4)
Type: Expression(Integer)
fricas
p:=retractNumeratorToPolyInt(san)

\label{eq5}\begin{array}{@{}l}
\displaystyle
{{\left(\%C + \%A \right)}\ {{n}^{2}}}+{{\left({
\begin{array}{@{}l}
\displaystyle
{{\left(\%D -{2 \  \%C}+ \%B - \%A \right)}\  k}- \%D + 
\
\
\displaystyle
\%C - \%B + \%A 
(5)
Type: Polynomial(Integer)
fricas
--
d:=degree(p,k)

\label{eq6}2(6)
Type: PositiveInteger?
fricas
eqs:=[coefficient(p,k,l)=0 for l in 0..d]

\label{eq7}\begin{array}{@{}l}
\displaystyle
\left[{{{{\left(\%C + \%A \right)}\ {{n}^{2}}}+{{\left(- \%D + \%C - \%B + \%A \right)}\  n}- \%D}= 0}, \: \right.
\
\
\displaystyle
\left.{{{{\left(\%D -{2 \  \%C}+ \%B - \%A \right)}\  n}+{2 \  \%D}- \%C}= 0}, \: \right.
\
\
\displaystyle
\left.{{- \%D + \%C}= 0}\right] 
(7)
Type: List(Equation(Polynomial(Integer)))
fricas
v:=members cm

\label{eq8}\left[ \%A , \: \%B , \: \%C , \: \%D \right](8)
Type: List(Expression(Integer))
fricas
vv:=variables(v)

\label{eq9}\left[ \%A , \: \%B , \: \%C , \: \%D \right](9)
Type: List(Symbol)
fricas
x:=[s::Symbol for s in v]

\label{eq10}\left[ \%A , \: \%B , \: \%C , \: \%D \right](10)
Type: List(Symbol)
fricas
sol:=solve(eqs,x) -- check #sol=1

\label{eq11}\left[{\left[{\%A ={{-{\%F \  n}+ \%F}\over n}}, \:{\%B = 0}, \:{\%C = \%F}, \:{\%D = \%F}\right]}\right](11)
Type: List(List(Equation(Fraction(Polynomial(Integer)))))
fricas
e:=findCoeffs(p,cm,k)

\label{eq12}\left[{\%A ={{-{\%G \  n}+ \%G}\over n}}, \:{\%B = 0}, \:{\%C = \%G}, \:{\%D = \%G}\right](12)
Type: List(Equation(Fraction(Polynomial(Integer))))
fricas
ss:=eval(cm,sol.1)

\label{eq13}\left[ 
\begin{array}{cc}
{{-{\%F \  n}+ \%F}\over n}& 0 
\
\%F & \%F 
(13)
Type: Matrix(Expression(Integer))
fricas
--
G:=operator 'G

\label{eq14}G(14)
Type: BasicOperator?
fricas
I:=J:=1

\label{eq15}1(15)
Type: PositiveInteger?
fricas
g:Matrix(X):=matrix [[G(n-j,k-i) for i in 0..I] for j in 0..J]

\label{eq16}\left[ 
\begin{array}{cc}
{G \left({n , \: k}\right)}&{G \left({n , \:{k - 1}}\right)}
\
{G \left({{n - 1}, \: k}\right)}&{G \left({{n - 1}, \:{k - 1}}\right)}
(16)
Type: Matrix(Expression(Integer))
fricas
sf:Matrix X:=ss*transpose(g)

\label{eq17}\left[ 
\begin{array}{cc}
{{{\left(-{\%F \  n}+ \%F \right)}\ {G \left({n , \: k}\right)}}\over n}&{{{\left(-{\%F \  n}+ \%F \right)}\ {G \left({{n - 1}, \: k}\right)}}\over n}
\
{{\%F \ {G \left({n , \: k}\right)}}+{\%F \ {G \left({n , \:{k - 1}}\right)}}}&{{\%F \ {G \left({{n - 1}, \: k}\right)}}+{\%F \ {G \left({{n - 1}, \:{k - 1}}\right)}}}
(17)
Type: Matrix(Expression(Integer))
fricas
res:X:=reduce(_+,[sf(i,i) for i in 1..I+1])

\label{eq18}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left(-{\%F \  n}+ \%F \right)}\ {G \left({n , \: k}\right)}}+{\%F \  n \ {G \left({{n - 1}, \: k}\right)}}+ 
\
\
\displaystyle
{\%F \  n \ {G \left({{n - 1}, \:{k - 1}}\right)}}
(18)
Type: Expression(Integer)
fricas
fex:=formalExpr(G,cm,I,J)

\label{eq19}\begin{array}{@{}l}
\displaystyle
{\%A \ {G \left({n , \: k}\right)}}+{\%B \ {G \left({n , \:{k - 1}}\right)}}+{\%C \ {G \left({{n - 1}, \: k}\right)}}+ 
\
\
\displaystyle
{\%D \ {G \left({{n - 1}, \:{k - 1}}\right)}}
(19)
Type: Expression(Integer)
fricas
H:=(n:X,k:X):X+->binomial(n,k)

\label{eq20}\mbox{theMap (...)}(20)
Type: ((Expression(Integer), Expression(Integer)) -> Expression(Integer))
fricas
celine(H,1,1)

\label{eq21}-{\%L \ {G \left({n , \: k}\right)}}+{\%L \ {G \left({{n - 1}, \: k}\right)}}+{\%L \ {G \left({{n - 1}, \:{k - 1}}\right)}}(21)
Type: Expression(Integer)
fricas
Q:=(n:X,k:X):X+->binomial(n,k)^2

\label{eq22}\mbox{theMap (...)}(22)
Type: ((Expression(Integer), Expression(Integer)) -> Expression(Integer))
fricas
celine(Q,2,2)

\label{eq23}{\left(
\begin{array}{@{}l}
\displaystyle
{\%V \  n \ {G \left({n , \: k}\right)}}+{{\left(-{2 \  \%V \  n}+ \%V \right)}\ {G \left({{n - 1}, \: k}\right)}}+ 
\
\
\displaystyle
{{\left(-{2 \  \%V \  n}+ \%V \right)}\ {G \left({{n - 1}, \:{k - 1}}\right)}}+ 
\
\
\displaystyle
{{\left({\%V \  n}- \%V \right)}\ {G \left({{n - 2}, \: k}\right)}}+ 
\
\
\displaystyle
{{\left(-{2 \  \%V \  n}+{2 \  \%V}\right)}\ {G \left({{n - 2}, \:{k - 1}}\right)}}+ 
\
\
\displaystyle
{{\left({\%V \  n}- \%V \right)}\ {G \left({{n - 2}, \:{k - 2}}\right)}}
(23)
Type: Expression(Integer)
fricas
R:=(n:X,k:X):X+->(-1)^k*factorial(n)*'x::X^k/(factorial(k)^2*factorial(n-k))

\label{eq24}\mbox{theMap (...)}(24)
Type: ((Expression(Integer), Expression(Integer)) -> Expression(Integer))
fricas
RC:=celine(R,2,2)

\label{eq25}{\left(
\begin{array}{@{}l}
\displaystyle
-{\%BH \ {{n}^{2}}\ {G \left({n , \: k}\right)}}+ 
\
\
\displaystyle
{{\left({2 \  \%BG \ {{n}^{2}}}-{\%BG \  n}\right)}\ {G \left({n , \:{k - 1}}\right)}}+ 
\
\
\displaystyle
{{\left({2 \  \%BH \ {{n}^{2}}}-{\%BH \  n}\right)}\ {G \left({{n - 1}, \: k}\right)}}+ 
\
\
\displaystyle
{{\left({
\begin{array}{@{}l}
\displaystyle
-{\%BH \  n \  x}-{4 \  \%BG \ {{n}^{2}}}+ 
\
\
\displaystyle
{4 \  \%BG \  n}- \%BG 
(25)
Type: Expression(Integer)
fricas
ch:=n*R(n,k-1)+(-2*n+1)*R(n-1,k-1)+'x::X*R(n-1,k-2)+(n-1)*R(n-2,k-1)

\label{eq26}{\left(
\begin{array}{@{}l}
\displaystyle
{
\begin{array}{@{}l}
\displaystyle
{\left({
\begin{array}{@{}l}
\displaystyle
{n \ {{{\left(k - 2 \right)}!}^{2}}\ {{\left(n - k - 1 \right)}!}\ {{\left(n - k \right)}!}\ {n !}}+ 
\
\
\displaystyle
{{\left(-{2 \  n}+ 1 \right)}\ {{{\left(k - 2 \right)}!}^{2}}\ {{\left(n - k - 1 \right)}!}\ {{\left(n - k + 1 \right)}!}\ {{\left(n - 1 \right)}!}}+ 
\
\
\displaystyle
{{\left(n - 1 \right)}\ {{{\left(k - 2 \right)}!}^{2}}\ {{\left(n - k \right)}!}\ {{\left(n - k + 1 \right)}!}\ {{\left(n - 2 \right)}!}}
(26)
Type: Expression(Integer)
fricas
normalize(ch)

\label{eq27}0(27)
Type: Expression(Integer)
fricas
celine((n,k)+->n*k,1,1)

\label{eq28}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left(-{\%BM \  n}+ \%BM \right)}\ {G \left({n , \: k}\right)}}+ 
\
\
\displaystyle
{{\left(-{\%BN \  n}+ \%BN \right)}\ {G \left({n , \:{k - 1}}\right)}}+ 
\
\
\displaystyle
{\%BM \  n \ {G \left({{n - 1}, \: k}\right)}}+{\%BN \  n \ {G \left({{n - 1}, \:{k - 1}}\right)}}
(28)
Type: Expression(Integer)
fricas
-- [13] (D,List(Equation(D2))) -> D from D
--            if D has EVALAB(D2) and D2 has SETCAT
-- [32] (Fraction(Polynomial(D3)),List(Equation(Fraction(Polynomial(D3)
--            )))) -> Fraction(Polynomial(D3))
--            from RationalFunction(D3) if D3 has INTDOM
SC:=celine((n,k)+->binomial(n,k)*binomial(2*k,k)*(-1/2)^k,2,2)

\label{eq29}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left(- \%BY -{2 \  \%BX}\right)}\  n \ {G \left({n , \: k}\right)}}- 
\
\
\displaystyle
{2 \  \%BY \  n \ {G \left({n , \:{k - 1}}\right)}}+ 
\
\
\displaystyle
{{\left({{\left({2 \  \%BY}+{4 \  \%BX}\right)}\  n}- \%BY -{2 \  \%BX}\right)}\ {G \left({{n - 1}, \: k}\right)}}+ 
\
\
\displaystyle
{{\left({
\begin{array}{@{}l}
\displaystyle
{{\left({2 \  \%BY}-{4 \  \%BX}\right)}\  n}- \%BY + 
\
\
\displaystyle
{2 \  \%BX}
(29)
Type: Expression(Integer)
fricas
SCA:=subst(SC,[%DA=a,%CZ=b])*4*(n-1)

\label{eq30}\begin{array}{@{}l}
\displaystyle
{{\left(- \%BY -{2 \  \%BX}\right)}\  n \ {G \left({n , \: k}\right)}}-{2 \  \%BY \  n \ {G \left({n , \:{k - 1}}\right)}}+ 
\
\
\displaystyle
{{\left({{\left({2 \  \%BY}+{4 \  \%BX}\right)}\  n}- \%BY -{2 \  \%BX}\right)}\ {G \left({{n - 1}, \: k}\right)}}+ 
\
\
\displaystyle
{{\left({{\left({2 \  \%BY}-{4 \  \%BX}\right)}\  n}- \%BY +{2 \  \%BX}\right)}\ {G \left({{n - 1}, \:{k - 1}}\right)}}+ 
\
\
\displaystyle
{{\left(-{4 \  \%BY \  n}+{2 \  \%BY}\right)}\ {G \left({{n - 1}, \:{k - 2}}\right)}}+ 
\
\
\displaystyle
{{\left({{\left(- \%BY -{2 \  \%BX}\right)}\  n}+ \%BY +{2 \  \%BX}\right)}\ {G \left({{n - 2}, \: k}\right)}}+ 
\
\
\displaystyle
{{\left({4 \  \%BX \  n}-{4 \  \%BX}\right)}\ {G \left({{n - 2}, \:{k - 1}}\right)}}+ 
\
\
\displaystyle
{{\left({4 \  \%BY \  n}-{4 \  \%BY}\right)}\ {G \left({{n - 2}, \:{k - 2}}\right)}}
(30)
Type: Expression(Integer)
fricas
--
SC2:=celine((n,k)+->binomial(n,k)*binomial(2*k,k)*(-2)^(n-k),2,2)

\label{eq31}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left(- \%CJ -{2 \  \%CI}\right)}\  n \ {G \left({n , \: k}\right)}}-{2 \  \%CJ \  n \ {G \left({n , \:{k - 1}}\right)}}+ 
\
\
\displaystyle
{{\left({
\begin{array}{@{}l}
\displaystyle
{{\left(-{4 \  \%CJ}-{8 \  \%CI}\right)}\  n}+{2 \  \%CJ}+ 
\
\
\displaystyle
{4 \  \%CI}
(31)
Type: Expression(Integer)
fricas
SCA2:=subst(SC2,[%CJ=a,%CI=b])*16*(n-1)

\label{eq32}\begin{array}{@{}l}
\displaystyle
{{\left(-{2 \  b}- a \right)}\  n \ {G \left({n , \: k}\right)}}-{2 \  a \  n \ {G \left({n , \:{k - 1}}\right)}}+ 
\
\
\displaystyle
{{\left({{\left(-{8 \  b}-{4 \  a}\right)}\  n}+{4 \  b}+{2 \  a}\right)}\ {G \left({{n - 1}, \: k}\right)}}+ 
\
\
\displaystyle
{{\left({{\left({8 \  b}-{4 \  a}\right)}\  n}-{4 \  b}+{2 \  a}\right)}\ {G \left({{n - 1}, \:{k - 1}}\right)}}+ 
\
\
\displaystyle
{{\left({8 \  a \  n}-{4 \  a}\right)}\ {G \left({{n - 1}, \:{k - 2}}\right)}}+ 
\
\
\displaystyle
{{\left({{\left(-{8 \  b}-{4 \  a}\right)}\  n}+{8 \  b}+{4 \  a}\right)}\ {G \left({{n - 2}, \: k}\right)}}+ 
\
\
\displaystyle
{{\left({{16}\  b \  n}-{{16}\  b}\right)}\ {G \left({{n - 2}, \:{k - 1}}\right)}}+ 
\
\
\displaystyle
{{\left({{16}\  a \  n}-{{16}\  a}\right)}\ {G \left({{n - 2}, \:{k - 2}}\right)}}
(32)
Type: Expression(Integer)
fricas
SCB2:=subst(SCA2,[a=1,b=0])

\label{eq33}\begin{array}{@{}l}
\displaystyle
-{n \ {G \left({n , \: k}\right)}}-{2 \  n \ {G \left({n , \:{k - 1}}\right)}}+{{\left(-{4 \  n}+ 2 \right)}\ {G \left({{n - 1}, \: k}\right)}}+ 
\
\
\displaystyle
{{\left(-{4 \  n}+ 2 \right)}\ {G \left({{n - 1}, \:{k - 1}}\right)}}+{{\left({8 \  n}- 4 \right)}\ {G \left({{n - 1}, \:{k - 2}}\right)}}+ 
\
\
\displaystyle
{{\left(-{4 \  n}+ 4 \right)}\ {G \left({{n - 2}, \: k}\right)}}+{{\left({{16}\  n}-{16}\right)}\ {G \left({{n - 2}, \:{k - 2}}\right)}}
(33)
Type: Expression(Integer)
fricas
-- Example 4.3.3 of A=B (subst to get same result)
SCB3:=subst(SCA2,[a=-2*b])

\label{eq34}\begin{array}{@{}l}
\displaystyle
{4 \  b \  n \ {G \left({n , \:{k - 1}}\right)}}+{{\left({{16}\  b \  n}-{8 \  b}\right)}\ {G \left({{n - 1}, \:{k - 1}}\right)}}+ 
\
\
\displaystyle
{{\left(-{{16}\  b \  n}+{8 \  b}\right)}\ {G \left({{n - 1}, \:{k - 2}}\right)}}+ 
\
\
\displaystyle
{{\left({{16}\  b \  n}-{{16}\  b}\right)}\ {G \left({{n - 2}, \:{k - 1}}\right)}}+ 
\
\
\displaystyle
{{\left(-{{32}\  b \  n}+{{32}\  b}\right)}\ {G \left({{n - 2}, \:{k - 2}}\right)}}
(34)
Type: Expression(Integer)
fricas
SCB3:=subst(%,[b=1/4])

\label{eq35}\begin{array}{@{}l}
\displaystyle
{n \ {G \left({n , \:{k - 1}}\right)}}+{{\left({4 \  n}- 2 \right)}\ {G \left({{n - 1}, \:{k - 1}}\right)}}+ 
\
\
\displaystyle
{{\left(-{4 \  n}+ 2 \right)}\ {G \left({{n - 1}, \:{k - 2}}\right)}}+{{\left({4 \  n}- 4 \right)}\ {G \left({{n - 2}, \:{k - 1}}\right)}}+ 
\
\
\displaystyle
{{\left(-{8 \  n}+ 8 \right)}\ {G \left({{n - 2}, \:{k - 2}}\right)}}
(35)
Type: Expression(Integer)
fricas
SCB3:=subst(%,[k=k+1])

\label{eq36}\begin{array}{@{}l}
\displaystyle
{n \ {G \left({n , \: k}\right)}}+{{\left({4 \  n}- 2 \right)}\ {G \left({{n - 1}, \: k}\right)}}+ 
\
\
\displaystyle
{{\left(-{4 \  n}+ 2 \right)}\ {G \left({{n - 1}, \:{k - 1}}\right)}}+{{\left({4 \  n}- 4 \right)}\ {G \left({{n - 2}, \: k}\right)}}+ 
\
\
\displaystyle
{{\left(-{8 \  n}+ 8 \right)}\ {G \left({{n - 2}, \:{k - 1}}\right)}}
(36)
Type: Expression(Integer)




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