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?

$\endgroup$
7
$\begingroup$

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$.

$\endgroup$
  • 1
    $\begingroup$ Perfect, thanks! $\endgroup$ – ron33 Dec 9 '11 at 23:31
4
$\begingroup$

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

$\endgroup$
0
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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