Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want your help to arrange the values of a sequence or function in a tabular form automatically by giving the "seq" command in maple 12.

e.g. $f(n)=n^2$

$$ \begin{array}{|l|l|} \hline n&f(n)\\ \hline0 & 0\\ \hline 1 & 1\\ \hline 2&4\\ \hline 3&9\\ \hline \vdots&\vdots\\\hline \end{array} $$

share|cite|improve this question
up vote 0 down vote accepted

The seq command alone doesn't do it, but you can try something like this:

> chart:= proc (head::list, vals::list)   
      Matrix([head, seq(eval(subs(head[1] = vals[i],head)),
         i = 1 .. nops(vals))])
     end proc;

Then, for example:

> chart([x,x^2],[$0..5]);

$$\left[ \begin {array}{cc} x&{x}^{2}\\ 0&0\\ 1&1\\ 2&4\\ 3&9\\ 4 &16\\ 5&25\end {array} \right] $$

share|cite|improve this answer
Thank you sir. This program works upto $n=8$ in maple 12. I want to have the sequence upto $\infty$. – Litun John Oct 15 '12 at 4:32
> interface(rtablesize=infinity); – Robert Israel Oct 15 '12 at 4:44
Thank you sir, Now I want to plot those data points in maple. I don't know the maple code. – Litun John Oct 17 '12 at 13:47
plot(%[2..-1,..],style=point); – Robert Israel Oct 17 '12 at 14:27
If there is discontinuity at the beginning e.g$$ \begin{array}{|l|l|l|} \hline n&f(n)&g(n)&\cdots\\ \hline0 & 2&1&\cdots\\ \hline 1 & 1&1&\cdots\\ \hline 2&4&8&\cdots\\ \hline 3&9&27&\cdots\\ \hline \vdots&\vdots&\vdots&\vdots\\ \hline \end{array} $$ How to show it in tabular form and the plot in maple? – Litun John Oct 18 '12 at 4:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.