lcm(a,b) = (a*b)/gcd(a,b)

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 562
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

lcm(a,b) = (a*b)/gcd(a,b)

Message par compsystems » mer. nov. 21, 2018 1:00 am

Hi, BP,

at XCAS
lcm(a,b) ↲ a*b

and the books

lcm(a, b) = (a*b)/gcd(a, b)

Why?

parisse
Messages : 5739
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: lcm(a,b) = (a*b)/gcd(a,b)

Message par parisse » mer. nov. 21, 2018 6:56 am

lcm(a,b) does not return a*b.
Try lcm(6,4) for example

compsystems
Messages : 562
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: lcm(a,b) = (a*b)/gcd(a,b)

Message par compsystems » mer. nov. 21, 2018 1:22 pm

numerically if it returns the correct value, symbolically not.

assume(a, symbol):; assume(b, symbol):; [↲]
gcd(a, b) [↲] 1 ↦ (a* b)/lcm(a, b)

parisse
Messages : 5739
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: lcm(a,b) = (a*b)/gcd(a,b)

Message par parisse » mer. nov. 21, 2018 2:37 pm

a and b are considered as polynomials, since they are prime together lcm(a,b) is a*b.

compsystems
Messages : 562
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: lcm(a,b) = (a*b)/gcd(a,b)

Message par compsystems » mer. nov. 21, 2018 3:44 pm

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))

parisse
Messages : 5739
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: lcm(a,b) = (a*b)/gcd(a,b)

Message par parisse » mer. nov. 21, 2018 6:04 pm

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).

Répondre