Question: for - loop question on supression

I have a simple loop and a couple of questions

a:=1:
n:=30:
for i from 1 to n do
   a := nextprime(a),i:
od;

Why didn't the colon supress the output?  And how do I get the output in the form i,a ?  I tried what I thought might have worked i,a:=nextprime(a):

Then I wanted the output displayed across the screen, I don't want the numbers to display vertically but rather continually like in a set or list like   1,2 2,3 3,5 4,7 etc ... maybe with brackets it would probably show better, I'm not sure but I can't figure it out.

The only reason I came into this silly thing was when I came across this blog for finding the set of prime numbers and thought I'd come up with a slightly different way using a for loop http://www.mapleprimes.com/blog/stephen-forrest/finding-the-set-of-prime-numbers-le-n

Anyways I got stumped trying to figure out different ways to display the output.  I didn't try to see how fast this was using time() but my guess is, it's quite slow compared to his other approaches.  Anyways, can anyone help?   

Please Wait...