I need to draw something in TikZ using double loop foreach where in a set in second loop will be the power of number from the first loop. My code isn't work. There is an error when I give 2^{\a}
in the second loop. How can I correct it?
\begin{tikzpicture}
\foreach \a in {1,2,3}
{
\foreach \b in {1,2,...,2^{\a}}
{
\draw (0,\a)--(\b,0);
}
}
\end{tikzpicture}
\b=2^{\a}
through multiplication.