Sun Jul 12 00:26:43 MET DST 1998 anne % axiom Axiom Computer Algebra System (Release 2.1) Digital Unix on DEC Alpha (AXIOM Sockets) The AXIOM server number is undefined. ----------------------------------------------------------------------------- Issue )copyright to view copyright notices. Issue )summary for a summary of useful system commands. Issue )quit to leave AXIOM and return to shell. ----------------------------------------------------------------------------- initial (1) -> -- ----------[ A x i o m ]---------- -- ---------- Initialization ---------- )set messages autoload off )set messages time on )set quit unprotected -- ---------- Numbers ---------- -- Let's begin by playing with numbers: infinite precision integers -- => 30414 0932017133 7804361260 8166064768 8443776415 6896051200 0000000000 factorial(50) (1) 30414093201713378043612608166064768844377641568960512000000000000 Type: PositiveInteger Time: 0.03 (EV) + 0.02 (OT) + 0.03 (GC) = 0.08 sec -- => 2^47 3^22 5^12 7^8 11^4 13^3 17^2 19^2 23^2 29 31 37 41 43 47 factor(%) 47 22 12 8 4 3 2 2 2 (2) 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 Type: Factored Integer Time: 0.03 (EV) + 0.05 (OT) = 0.08 sec -- Double factorial => 10!! = 10*8*6*4*2 = 3840, 9!! = 9*7*5*3*1 = 945 --[10!!, 9!!] -- ABC base 16 => 2748 base 10 abc (3) abc Type: Variable abc Time: 0 sec -- 123 base 10 => 234 base 7 radix(123, 7) (4) 234 Type: RadixExpansion 7 Time: 0.02 (IN) + 0.02 (EV) + 0.03 (OT) + 0.02 (GC) = 0.08 sec -- 677 base 8 => 1BF base 16 radix(447, 16) (5) 1BF Type: RadixExpansion 16 Time: 0.02 (EV) + 0.03 (OT) = 0.05 sec -- [log base 8](32768) => 5 log(32768)/log(8) log(32768) (6) ---------- log(8) Type: Expression Integer Time: 0.03 (IN) + 0.33 (EV) + 0.12 (OT) + 0.12 (GC) = 0.60 sec -- 5^(-1) mod 7 => 3; 5^(-1) mod 6 => 5 (5 :: PrimeField 7)**(-1) (7) 3 Type: PrimeField 7 Time: 0.03 (IN) + 0.03 (OT) = 0.07 sec recip(5 :: PrimeField(7)) (8) 3 Type: Union(PrimeField 7,...) Time: 0.02 (OT) = 0.02 sec invmod(5, 7) (9) 3 Type: PositiveInteger Time: 0 sec (5 :: IntegerMod 6)**(-1) Compiling function G82136 with type Integer -> Boolean There are 20 exposed and 17 unexposed library operations named ** having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op ** to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named ** with argument type(s) IntegerMod 6 Integer recip(5 :: IntegerMod 6) (10) 5 Type: Union(IntegerMod 6,...) Time: 0.02 (EV) = 0.02 sec invmod(5, 6) (11) 5 Type: PositiveInteger Time: 0 sec -- Greatest common divisor => 74 reduce(gcd, [1776, 1554, 5698]) (12) 74 Type: PositiveInteger Time: 0.03 (OT) = 0.03 sec -- Infinite precision rational numbers => 4861/2520 1/2 + 1/3 + 1/4 + 1/5 + 1/6 + 1/7 + 1/8 + 1/9 + 1/10 4861 (13) ---- 2520 Type: Fraction Integer Time: 0.05 (IN) = 0.05 sec -- Complete decimal expansion of a rational number => 0.142857 ... decimal(1/7) ______ (14) 0.142857 Type: DecimalExpansion Time: 0.02 (IN) + 0.02 (EV) = 0.03 sec -- Multiply two complete decimal expansions and produce an exact result => 2 decimal(7/11) * decimal(22/7) (15) 2 Type: DecimalExpansion Time: 0.02 (IN) = 0.02 sec -- This number should immediately simplify to 3^(1/3) 10/7 * (1 + 29/1000)**(1/3) 3+-+ (16) \|3 Type: AlgebraicNumber Time: 0.20 (IN) + 0.02 (EV) + 0.02 (OT) = 0.23 sec -- Simplify an expression with nested square roots => 1 + sqrt(3) sqrt(2*sqrt(3) + 4) +---------+ | +-+ (17) \|2\|3 + 4 Type: AlgebraicNumber Time: 0.03 (IN) + 0.02 (EV) + 0.05 (OT) = 0.10 sec simplify(%) +---------+ | +-+ (18) \|2\|3 + 4 Type: Expression Integer Time: 0.10 (EV) + 0.02 (OT) = 0.12 sec -- Try a more complicated example (from the Putnam exam) => 3 + sqrt(2) sqrt(14 + 3*sqrt(3 + 2*sqrt(5 - 12*sqrt(3 - 2*sqrt(2))))) +---------------------------------------+ | +------------------------------+ | | +----------------------+ | | | +-----------+ | | | | +-+ (19) \|3\|2\|- 12\|- 2\|2 + 3 + 5 + 3 + 14 Type: AlgebraicNumber Time: 0.05 (IN) + 0.03 (OT) = 0.08 sec -- See D.J. Jeffrey and A.D. Rich, ``The nesting habits of radicals'', draft of -- 1998 => sqrt(2) + sqrt(3) + sqrt(5) sqrt(10 + 2*sqrt(6) + 2*sqrt(10) + 2*sqrt(15)) +----------------------------+ | +--+ +--+ +-+ (20) \|2\|15 + 2\|10 + 2\|6 + 10 Type: AlgebraicNumber Time: 0.05 (IN) + 0.02 (EV) + 0.02 (OT) = 0.08 sec -- Rationalize the denominator => 5 + 2 sqrt(6) (sqrt(3) + sqrt(2))/(sqrt(3) - sqrt(2)) +-+ +-+ (21) 2\|2 \|3 + 5 Type: AlgebraicNumber Time: 0.03 (IN) + 0.22 (EV) + 0.02 (OT) = 0.27 sec -- A factorization of 3 in the integers extended by sqrt(-5) sqrt(-2 + sqrt(-5)) * sqrt(-2 - sqrt(-5)) +------------+ +----------+ | +---+ | +---+ (22) \|- \|- 5 - 2 \|\|- 5 - 2 Type: AlgebraicNumber Time: 0.02 (IN) + 0.02 (EV) + 0.02 (OT) = 0.05 sec -- => 3 + sqrt(7) [Jeffrey and Rich] (90 + 34*sqrt(7))^(1/3) +-----------+ 3| +-+ (23) \|34\|7 + 90 Type: AlgebraicNumber Time: 0.05 (IN) + 0.02 (OT) = 0.07 sec -- This is a nontrivial way of writing 12 ! ((135 + 78*sqrt(3))**(2/3) + 3)*sqrt(3)/(135 + 78*sqrt(3))**(1/3) +------------+2 +------------+ +-+ 3| +-+ +-+3| +-+ (24) (- 15\|3 + 26)\|78\|3 + 135 + \|3 \|78\|3 + 135 Type: AlgebraicNumber Time: 0.05 (IN) + 0.07 (EV) + 0.02 (OT) = 0.13 sec % :: Float (25) 11.9999999999 99999998 Type: Float Time: 0.17 (IN) + 0.03 (OT) = 0.20 sec -- See David Jeffrey, ``Current Problems in Computer Algebra Systems'', talk -- => 1 + sqrt(2) (49 + 21*sqrt(2))^(1/5) +-----------+ 5| +-+ (26) \|21\|2 + 49 Type: AlgebraicNumber Time: 0.05 (IN) + 0.02 (OT) = 0.07 sec -- A nasty example generated by Axiom => [log(sqrt(2) + 1) + sqrt(2)]/3 q:= ((6 - 4*sqrt(2))*log(3 - 2*sqrt(2)) + (3 - 2*sqrt(2))*log(17 - 12*sqrt(2)) _ + 32 - 24*sqrt(2)) / (48*sqrt(2) - 72) (27) +-+ +-+ +-+ +-+ +-+ (- 4\|2 + 6)log(- 2\|2 + 3) + (- 2\|2 + 3)log(- 12\|2 + 17) - 24\|2 + 32 ----------------------------------------------------------------------------- +-+ 48\|2 - 72 Type: Expression Integer Time: 0.43 (IN) + 0.05 (EV) + 0.07 (OT) = 0.55 sec q :: Float Cannot convert from type Expression Integer to Float for value +-+ +-+ +-+ +-+ +-+ (- 4\|2 + 6)log(- 2\|2 + 3) + (- 2\|2 + 3)log(- 12\|2 + 17) - 24\|2 + 32 ----------------------------------------------------------------------------- +-+ 48\|2 - 72 q :: Complex Float (28) 0.7651957164 6421269157 Type: Complex Float Time: 0.25 (IN) + 0.03 (GC) = 0.28 sec (log(sqrt(2) + 1) + sqrt(2))/3 :: Float (29) 0.7651957164 6421269135 Type: Expression Float Time: 0.35 (IN) + 0.05 (OT) = 0.40 sec )clear properties q -- Cardinal numbers => infinity 2*Aleph(0) - 3 (30) Aleph(0) Type: Union(CardinalNumber,...) Time: 0.13 (IN) = 0.13 sec -- 2^aleph_0 => aleph_1 2**Aleph(0) >> Error detected within library code: Transfinite exponentiation only implemented under GCH initial (31) -> real 12.4 user 5.8 sys 0.4