I think you want this:
#!/bin/bash
for i in 0 1 2
do
sleep 3 & a[$i]=$!
done
wait
echo ${a[@]}
You are missing the $
on the array index $i
in your script. Also, you don't need to say which PIDs you are wating for if you are waiting for all of them. And you also said you wanted to see the list of PIDs at the end.