Intereting Posts

Number of Differentiable Structures on a Smooth Manifold
This tower of fields is being ridiculous
How to determine equation for $\sum_{k=1}^n k^3$
What does “relatively closed” mean?
Various evaluations of the series $\sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)^3}$
Does $\bigcap_{n=1}^{+\infty}(-\frac{1}{n},\frac{1}{n}) = \varnothing$?
Expected value of the number of flips until the first head
Example of nested closed balls with empty intersection?
What are some examples of principal, proper ideals that have height at least $2$?
Is the number 0.2343434343434.. rational?
Do We Need the Digits of $\pi$?
Prove that $A \subset B$ if and only if $A \cap B = A$
Odd/Even Permutations
Is there a difference between $y(x)$ and $f(x)$
On the change of coordinates of a matrix.

Question: How do I substitute a value into a polynomial in GAP?

So, if I start off with the following:

```
x:=Indeterminate(Integers,"x");
f:=x^2+3;
```

I have $f$ as the polynomial $x^2+3$ over the integers. How can I find, say, $f(100)$?

- Wisdom of using Sympy as a first CAS
- Most wanted reproducible results in computational algebra
- How to find the closed form of 10.3500574150076 with software/algorithm?
- Computing Invariant Subspaces of Matrix Groups
- Resultant of Two Univariate Polynomials
- Tell Wolfram Alpha that a variable is a natural number

There should be a simple one line answer, but I can’t seem to find it in the help files.

- Differences between GAP and PARI/GP?
- Erroneous numerical approximations of $\zeta\left(\frac{1}{2}\right)$?
- Action of $S_7$ on the set of $3$-subsets of $\Omega$
- What are some good iPhone/iPod Touch/iPad Apps for mathematicians?
- Most wanted reproducible results in computational algebra
- Structure Descriptions (GAP) in semigroups
- Is there a computer programm or CAS (maybe GAP?) that can calculate with projective (indecomposable) A-modules (A is a finite dimensional k-algebra)?
- Can you recommend a decent online or software calculator?
- Finding the subgroup of $(\mathbb Z_{56},+)$ which is isomorphic with $(\mathbb Z_{14},+)$ by GAP
- Computing Invariant Subspaces of Matrix Groups

Please see ‘?Value’:

```
gap> x:=Indeterminate(Integers,"x");;
gap> f:=x^2+3;;
gap> Value(f,100);
10003
```

Similarly, for multivariate polynomials do:

```
gap> x:=Indeterminate(Integers,"x");;
gap> y:=Indeterminate(Integers,"y");;
gap> f:=x*y+y+x^7;
x^7+x*y+y
gap> Value(f,[x,y],[5,7]);
78167
```

**Remark (added later):** furthermore, substitution is not limited to the elements of the ring of coefficients. One could, for example, substitute indeterminates like here

```
gap> x:=Indeterminate(Integers,"x");;
gap> y:=Indeterminate(Integers,"y");;
gap> z:=Indeterminate(Integers,"`");;
gap> f:=x*y+y+x^7+z;
x^7+x*y+y+z
gap> g:=Value(f,[x,y],[z^2,2]);
z^14+2*z^2+z+2
gap> Value(g,2);
16396
```

or matrices like here:

```
gap> m:=[ [ 0, -1, -1, 0, 0 ],
> [ 0, 0, 0, 1, 0 ],
> [ 0, 0, 0, 0, 1 ],
> [ 1, 0, 0, 0, 0 ],
> [ 0, 0, 1, 0, 0 ] ];;
gap> charpol:=CharacteristicPolynomial(m);
x^5-x^3+x^2-1
gap> Value(charpol,m);
[ [ 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0 ] ]
```

- How to evaluate $ \int_0^1 {\log x \log(1-x) \log^2(1+x) \over x} \,dx $
- Idempotence of the interior of the closure
- Determine if vectors are linearly independent
- Topological spaces in which every proper closed subset is compact
- Reference for Topological Groups
- Exercise 3.7 Hartshorne
- How do you factor a quadratic expression, without using the formula?
- A combinatorial sum and identity involving Stirling numbers of the second kind
- Where does one use holomorphicity in the proof of Goursat's theorem?
- Which of the following polynomials are subspaces of $\mathbb{P}_n$ for an appropriate value of n?
- Finding the limit of sequence
- Matrix non-identity
- Number of distinct arrangements {$n_i$} $n_1<n_2<n_3<n_4<n_5$ such that $\sum n_i=20$
- For which angles we know the $\sin$ value algebraically (exact)?
- Find the $n$th term of $1, 2, 5, 10, 13, 26, 29, …$