function p=ex322(n)
    pr=ones(1,n);pr(1)=0;
    for k=2:round(n^0.5)
        if(pr(k)==1)
            for m=2*k:n
                if(mod(m,k)==0)
                    pr(m)=0;
                end
            end
        end
    end
    p=find(pr);