# Similar Variable Names

I have variables $X1,...,X10$ and $X1hat,..., X10hat$ in a system of equations. How can I refer to these variables in a summation? I am looking for something like:

Sum[Xi' Xi'hat,{i,10}]

• Instead of x1, use x[1]. Then you can use x[i]. – Szabolcs May 7 '17 at 7:37
• Thanks! It solved my problem for variables. But is there also a way to do something similar for an equation to avoid writing it multiple times? For example instead of writing eq1=X[1]^2,...,eq10=X[10]^2, write something like: {eq[i] = X[i]^2, {i, 10}} in a system of equations? – Hossein May 7 '17 at 7:51
• Use Table to make a list of equations. – Szabolcs May 7 '17 at 8:55