function p7=ex331(n)
    ps=[2,3,5,7,11,zeros(1,n-5)];
    cnt=5;nn=11;
    while(cnt~=n)
        if(isempty(find(mod(nn,ps)==0)))
            cnt=cnt+1;ps(cnt)=nn;
        end
        nn=nn+2;
    end
    p7=ps(n);