## Using the sage mathematical software system This article describes the installation and simple usage of the Sage mathematical software system. Sage is free, open-source math software that supports research and teaching in algebra, geometry, number theory, cryptography, numerical computation, and related areas.

We start by installing Sage on Ubuntu:

```sudo apt-get install sagemath
```

Let’s take a look at what the Sage commandprompt can give us:

```sage
```

This will present you with a prompt that says “sage:”. You can type things here that Sage will try to understand and solve. For example, if we type “2+3”, Sage will respond with “5”:

```sage: 2+3
5
```

Now let’s try to solve something a bit more difficult:

```sage: a, b = var('a, b')
sage: solve([a + b == 12, a - b == 6], [a, b])
[[a == 9, b == 3]]
```

There are numerous functions you can use. We will show some of them here:

```sage: factor(60)
2^2 * 3 * 5

sage: is_prime(1234567891)
True

sage: gcd(100, 24)
4
```

Using some Python magic, we can do things like:

```sage: [factor(n) for n in range(2, 10)]
[2, 3, 2^2, 5, 2 * 3, 7, 2^3, 3^2]
```
This entry was posted in programming and tagged . Bookmark the permalink.

### 1 Response to Using the sage mathematical software system

1. Harald Schilly says:

Hi, the debian package for Sage is terribly outdated :(