# Table: calculate the intermediate variable but not list them

I want to list {a,c} but c is depend on b, suppose the dependence on b can not written as a simple function c(b). How can I create a list of {a,c} list without list out b in the intermediate.

My workaround is this:

list = Table[{a, b = a^2, c = b^2}, {a, 0, 10, 1}];
listWanted = list[[All, {1, 3}]]


However suppose the intermediate variable is many, doing this is cumbersome, at least not neat. I just want to calculate these intermediate value but not list them.

• Obviously it depends on what you're actually doing (this might be too minimal an example), but you can certainly do list = Table[{a, (a^2)^2}, {a, 0, 10, 1}]. Commented Oct 26, 2015 at 3:41
• ...or, Table[{a, b = a^2; c = b^2}, {a, 0, 10, 1}]. Commented Oct 26, 2015 at 3:49
• @J.M. This is just what I want, thanks! Commented Oct 26, 2015 at 6:18
• @march I've said that c is can not be written as a simple function of a Commented Oct 26, 2015 at 6:19
• Did you understand what I replaced? If so, please write an answer to your own question. :) Commented Oct 26, 2015 at 6:22

One can using the ; operator to do the evaluation, but suppress the output. So the code can be the following as pointed out in the comment:
Table[{a, b = a^2; c = b^2}, {a, 0, 10, 1}]