4.5.2.5 Integers and Rationals

We illustrate arithmetic with integers and rationals in KASH.

sage: F = kash.Factorization(4352)
sage: F[1]
<2, 8>
sage: F[2]
<17, 1>
sage: F
[ <2, 8>, <17, 1> ], extended by:
  ext1 := 1,
  ext2 := Unassign

Note: For some very large numbers KASH's integer factorization seems much faster than PARI's (which is the default in SAGE).

sage: kash.GCD(15,25)
5
sage: kash.LCM(15,25)
75
sage: kash.Div(25,15)
1

sage: kash(17) % kash(5)
2

sage: kash.IsPrime(10007)
TRUE
sage: kash.IsPrime(2005)
FALSE

sage: kash.NextPrime(10007)
10009

See About this document... for information on suggesting changes.