This is what shell array variables are designed for (if your shell supports them); otherwise you need something like eval (and eval is dangerous except under very limited circumstances).
In both bash and ksh you can have arrays with integer subscripts (and with recent bash and 1993 or later ksh , you can also use non-numeric strings as subscripts). For example:
$ for((i = 1; i <= 5; i++))
do num[$i]=$(($i * $i))
done
$ for((i = 1; i <= 5; i++))
do printf 'num[%d]=%d\n' $i ${num[$i]}
done
num[1]=1
num[2]=4
num[3]=9
num[4]=16
num[5]=25
$