Tuesday, October 12, 2010

Prime factorization

for m=2 to 1000
n=m
print n+"=";
for f = 2 to n
if n/f = int (n/f) then
n=n/f
print f+"x";
f=f-1
end if
next f
print
next m

No comments:

Post a Comment