/* REXX version of a Prime Number Finder
haplo@mindstab.net */
max=arg(1)
sq=2
sqm=4
do cnt = 3 to max by +2
isp = 1
i = 3
do while i <= sq & isp = 1
if cnt // i = 0 then
do
isp = 0
end
i = i + 2
if isp \= 0 then
say cnt
if cnt >= sqm then
sq = sq+1
sqm = sq*sq