@jim hawkins, the program finds both, it determines if it is a prime number judging on how many prime factors the number has.
@hodgey Not sure, I'll have to look into it more, but I found that if I test up to half of the number being tested then I can make sure all prime factors are accounted for. I did this by dividing each number by 2 up to half of the testing number, if the result is a number requiring no decimal places (eg 2.0) then it is a prime factor.
example:
numbertesting=50
for a=1 to numbertesting/2
result#=numbertesting/2
if round(result#)<>result#
rem do nothing
else
rem prime factor
inc factor,1
endif
next a
rem if number being tested has just 1 factor then the number is a prime number (prime numbers have 2 factors, 1 and itself, but because I'm testing up to just half of the number then I only need to find 1 factor.
audiosparx.com/liambradburymusic - professional music for your games.