141のプログラム、やっぱり(a/2)の方が圧倒的に速いのでこうしたらいいのでは。

#include<stdio.h>

main()
{
 int a,b;

 for(a=2;;a++){
  for(b=2;b<(a/2);b++){
    if(a%b==0) goto next;
    }
  if(a!=4) printf("%d\n",a);
  next:;
}

}