Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Gcd

Function: gcd (<p_1>, <p_2>, <x_1>, ...) Returns the greatest common divisor of <p_1> and <p_2>. The flag gcd determines which algorithm is employed. Setting gcd to ez, subres, red, or spmod selects the ezgcd, subresultant prs, reduced, or modular algorithm, respectively. If gcd false then gcd (<p_1>, <p_2>, <x>) always returns 1 for all <x>. Many functions (e.g. ratsimp, factor, etc.) cause gcds to be taken implicitly. For homogeneous polynomials it is recommended that gcd equal to subres be used. To take the gcd when an algebraic is present, e.g., gcd (<x>^2 - 2*sqrt(2)*<x> + 2, <x> - sqrt(2)), algebraic must be true and gcd must not be ez.

sqfr(x^3-9);
remainder(expand((x^3+1)^3-2),a^3-9,a);
h:expand((x^2+2*x+5)^2*(x-1)^3*(x+2)*(x+1)^1);
g:gcd(h,diff(h,x));
c[1]:rat(h/g);
d[1]:rat(diff(h,x)/g-diff(c[1],x));
i:1;
while c[i]#1 do (/*print("c[",i,"]=",c[i]),*//*print("d[",i,"]=",d[i]),*/f[i]:gcd(c[i],d[i]),if f[i]#1 then (print("f[",i,"]=",f[i])),c[i+1]:rat(c[i]/f[i]),d[i+1]:rat(d[i]/f[i]-diff(c[i+1],x)),i:i+1);

The gcd flag, default: spmod, if false will also prevent the greatest common divisor from being taken when expressions are converted to canonical rational expression (CRE) form. This will sometimes speed the calculation if gcds are not required.

There are also some inexact matches for gcd. Try ?? gcd to see them.

(%o1)                                true
(%i2) 

Related Examples

gcd

gcd((2^6)-1,220459);

Calculate

gcd

gcd(24*60*60,11*3600+...

Calculate

gcd-ifactors

gcd(1010101,10101010);

ifactors(gcd(10101,10...

ifactors(73);

Calculate

gcd

gcd(58,42);

Calculate

gcd

gcd(25-5*i,8+14*i);

Calculate

gcd-load-primep-resultant

load("functs");

G:gcd(3810^5+3,3811^5...

primep(G);

Calculate

gcd-inv_mod-mod-power_mod

p:59604644783353249;

q:479001599;

n:p*q;

Calculate