4
$\begingroup$

I'm trying to get Wolfram Alpha to output a table of values over the integers for a given function, in example:

n^2-n

1----1

4----2

9----3

... ...

(using '-'s instead of whitespace to separate the columns)

Despite being a rather simple thing my searches for a command that does this turn up nothing. Does anyone know how I can get it to do this?

3 Answers 3

7

How about Mathematica commands? This is always the best first idea when using wolfram alpha.

Table[n^2, {n,1,10}]

for instance. If you want the table of the values of $n^2$ with $n$ between $1$ and $10$.

  • 1
    Perfect, thanks!2011-12-09
4

Try Table[n^2, {n, 1, 5}].

0

To get the output exactly in the form you describe in the question, you should use

TableForm[Table[{n^2,n},{n,1,k}]] 

For example:

enter image description here

EDIT: Well, it seems this only works in Mathematica proper. Oh well.