6

How to convert the output of the following code

```
In[43]:= Func[x_]:=Select[Range[x],Total[IntegerDigits[#]^3]==#&];
Func[1000]
```

which is

Out[44]= {1,153,370,371,407}

to the following form

such that I can copy it and paste to my LaTeX document without significant hassle.

## Edit

I want the output of Mathematica to be consumable for LaTeX engine.

```
1^3 & 1\\
1^3+5^3+3^3 & 153\\
3^3+7^3+0^3 & 370\\
3^3+7^3+1^3 & 371\\
4^3+0^3+7^3 & 407\\
```

Do you want to generate the first column or are you after the $LaTeX$ export part? – Yves Klett – 2013-12-30T17:04:20.410

@YvesKlett: The table contents must be generated by Mathematica so I can just copy and paste. – kiss my armpit – 2013-12-30T17:06:46.767

You are aware of

`TeXForm`

? E.g.`Grid[{{a, b, c}, {x, y^2, z^3}}, Frame -> All] // TeXForm`

... – Yves Klett – 2013-12-30T17:08:42.473@YvesKlett: Please show me how can you decompose each element of the list into the sum of cubes and make sure it is not evaluated. – kiss my armpit – 2013-12-30T17:11:21.973

Please add that info to your question to help understand it better. – Yves Klett – 2013-12-30T17:14:17.667

You could wait if other and better answers come in (I hope so!) and accept after a few days. Questions with accepted answers tend to attract fewer new answers... – Yves Klett – 2013-12-30T18:04:44.707