'Linux' math program with interactive terminal? Are there any open source math programs out there that have an interactive terminal and that work on linux?
So for example you could enter two matrices and specify an operation such as multiply and it would then return the answer or a error message specifying why an answer can't be computed? I am just looking for something that can perform basic matrix operations and modular arithmetic.
 A: Scilab is a good opensourced Matlab-like software. If you know Matlab, Scilab is very similar.
A: I suggest a computer algebra system, maxima, whose license is GPL, therefore it's entirely FREE. It specializes in symbolic operations but also offers numerical capablities.
If you hate command line interface, you can choose wxmaxima. It's just a good frontend of maxima.
And if you're a common lisp programmer, you can choose embeddable maxima. It provides the freedom of mixture between common lisp programs and maxima functions. I got this from an answer to my post
A: Sage is basically a Python program/interpreter that aims to be an open-source mathematical suite (ala Mathematica and Magma etc.). There are many algorithms implemented as a direct part of Sage, as well as wrapping many other open-source mathematics packages, all into a single interface (the user never has to tell which package or algorithm to use for a given computation: it makes the decisions itself). It includes GP/Pari and maxima, and so does symbolic manipulations and number theory at least as well as them.
It has a command-line mode, as well as a web notebook interface (as an example, a public server run by the main developers).
And, although this might not be relevant since your use-case sounds very simple, the syntax is just Python with a small preprocessing step to facilitate some technical details and allow some extra notation (like [1..4] which expands to [1,2,3,4]), so many people already know it and, if not, learning it is very easy.
As a slight tangent, Sage is actually the origin of the increasingly popular Cython language for writing fast "Python", and even offers an easy and transparent method of using Cython for sections of code in the notebook.
A: Depending on my use-case I either use Calc; the C-style arbitrary precision calculator or bc.
(Both are available on Linux/OSX/Windows)
Calc
Example matrix assignment:
mat [2][3] = {{1,2,3},{4,5,6}}

Documentation for multiplication of matrices:

A * B
Multiplication is defined provided certain conditions by the
    dimensions and shapes of A and B are satisfied.  If both have
    dimension 2 and the column-index-list for A is the same as
    the row-index-list for B, C = A * B is defined in the usual
    way so that for i in the row-index-list of A and j in the
    column-index-list for B,
                     C[i,j] =  Sum A[i,k] * B[k,j]

the sum being over k in the column-index-list of A.  The same
     formula is used so long as the number of columns in A is the same
     as the number of rows in B and k is taken to refer to the offset
     from matmin(A,2) and matmin(B,1), respectively, for A and B.
     If the multiplications and additions required cannot be performed,
     an execution error may occur or the result for C may contain
     one or more error-values as elements.
If A or B has dimension zero, the result for A * B is simply
     that of multiplying the elements of the other matrix on the
     left by A[] or on the right by B[].
If both A and B have dimension 1, A * B is defined if A and B
     have the same size; the result has the same index-list as A
     and each element is the product of corresponding elements of
     A and B.  If A and B have the same index-list, this multiplication
     is consistent with multiplication of 2D matrices if A and B are
     taken to represent 2D matrices for which the off-diagonal elements
     are zero and the diagonal elements are those of A and B.
     the real and complex numbers.
If A is of dimension 1 and B is of dimension 2, A * B is defined
     if the number of rows in B is the same as the size of A.  The
     result has the same index-lists as B; each row of B is multiplied
     on the left by the corresponding element of A.
If A is of dimension 2 and B is of dimension 1, A * B is defined
     if number of columns in A is the same as the size of A.  The
     result has the same index-lists as A; each column of A is
     multiplied on the right by the corresponding element of B.
The algebra of additions and multiplications involving both one-
     and two-dimensional matrices is particularly simple when all the
     elements are real or complex numbers and all the index-lists are
     the same, as occurs, for example, if for some positive integer n,
     all the matrices start as  mat [n]  or  mat [n,n].

A: In addition to the various heavy-weight tools already named, you should also take a look at Euler Math Toolbox. It is a free, portable, and open source math environment that supports both matrix operations and symbolic manipulation.
It has a straightforward notebook page usage model, with results, plots, and graphics interspersed with the commands and equations that produce them. It is also extensible via Python for those so inclined.
An interesting alternative for some applications is Geogebra. It is an interactive geometry, algebra, and calculus application, intended for teachers and students. 
Another interesting alternative to the well known tools is GSL Shell. This is a tool that wraps the Lua language around the Gnu Scientific Library. It supports a wide array of numeric methods on vectors and scalars. Being based on Lua, the syntax is distinctly different in flavor from the MATLAB inspired Octave or any of the tools based on Python. But that flavor might be to your liking.
A: A simple but quite functional alternative would be Genius. It has various numerical and plotting capabilities and a programming language (GEL).
A: The Julia language is an interesting up and coming numerical mathematics language that's been getting a lot of attention in recent months. It's sort of a mix of Matlab, R, and common Lisp.
A: I am aware of two packets that might help You:


*

*Octave - free clone of Matlab,  

*maxima - a packet for symbolic computations.


Octave is good when you want to do numerical calculations and you can accept numerical errors. Especially good for matrix/vector operations. I think this is what you want. Maxima is rather for symbolic computations. Both of them have text interface. If you want more user-friendly interface for the latter one, try wxMaxima.
A: For modular arithmetic and much more by way of number theory, I would strong recommend GP/Pari from here.
It does a huge variety of operations mostly relevant to number theory, but not limited to that area. It should be easily installable on most versions of Linux.
Added: just checked, and it also does a wide variety of vector/matrix and linear algebra stuff.
A: Its already a feature of your terminal.
Simply encapsulate your equation in $((  )) , for example ...
bash> echo $((1 + 1))
2

I only know this coz Im a programmer not a mathematician. :)
Have fun,
Eugene.
A: freemat 
FreeMat is a free environment for rapid engineering and scientific prototyping and data processing. It is similar to commercial systems 
A: I recommend numpy and scipy, which are packages for Python. The advantage over many dedicated mathematical packages is that they are packages for a well established language, meaning that they may easily integrated with all the other things you do with computers, such as generating images, reports, web pages, or interacting with a desktop application.
The ipython program provides a very useful shell for direct interaction with the packages. What's more, matplotlib is integrated with ipython through the command line switch
ipython --pylab

Look seriously at numpy, if you're interest is in matrices there are tools here which make your life very easy.
A: Yes, GNU Octave, the open source terminal equivalent of MATLAB. Most MATLAB code can be used in Octave directly, and their computation times are roughly equivalent. Octave can plot but does not have a GUI terminal.
A: Take a look at PARI/GP. But it's rather specific.
