Hi, BP,
at XCAS
lcm(a,b) ↲ a*b
and the books
lcm(a, b) = (a*b)/gcd(a, b)
Why?
lcm(a,b) = (a*b)/gcd(a,b)
Modérateur : xcasadmin
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: lcm(a,b) = (a*b)/gcd(a,b)
lcm(a,b) does not return a*b.
Try lcm(6,4) for example
Try lcm(6,4) for example
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: lcm(a,b) = (a*b)/gcd(a,b)
numerically if it returns the correct value, symbolically not.
assume(a, symbol):; assume(b, symbol):; [↲]
gcd(a, b) [↲] 1 ↦ (a* b)/lcm(a, b)
assume(a, symbol):; assume(b, symbol):; [↲]
gcd(a, b) [↲] 1 ↦ (a* b)/lcm(a, b)
Re: lcm(a,b) = (a*b)/gcd(a,b)
a and b are considered as polynomials, since they are prime together lcm(a,b) is a*b.
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: lcm(a,b) = (a*b)/gcd(a,b)
ok ^
lcm(a*x^0,b*x^0) [↲] a*b
but, you can add a new rule, if the user defines the following
assume(a,integer);additionally(a>0); assume(b,integer);additionally(b>0);
lcm(a,b) [↲] '(a* b)/gcd(a, b)'
Just remember the "formula" of this function. similarly to
abs(a+b*i) [↲] sqrt(a^2+b^2)
unitV(a+b*i) [↲] (a+b*i)/(sqrt(a^2+b^2))
lcm(a*x^0,b*x^0) [↲] a*b
but, you can add a new rule, if the user defines the following
assume(a,integer);additionally(a>0); assume(b,integer);additionally(b>0);
lcm(a,b) [↲] '(a* b)/gcd(a, b)'
Just remember the "formula" of this function. similarly to
abs(a+b*i) [↲] sqrt(a^2+b^2)
unitV(a+b*i) [↲] (a+b*i)/(sqrt(a^2+b^2))
Re: lcm(a,b) = (a*b)/gcd(a,b)
a and b are considered as multivariate polynomials (with respect to variables [a,b]).
There is no "rule" in lcm, lcm is a polynomial instruction (like gcd).
There is no "rule" in lcm, lcm is a polynomial instruction (like gcd).