% a number is prime IF the only numbers it is divisible by, with zero
%   remainder, is itself, and 1, and no other number in between

tic
n = 12345;
if (n<2)
    is_n_prime = false;
elseif (n==2)
    is_n_prime = true;
else
    is_n_prime = true;
    for i=2:floor(sqrt(n)) % efficiency #1
        fprintf("mod(%d,%d)=%d\n", n, i, mod(n,i));
        if (mod(n,i)==0)
            is_n_prime = false;
            break
        end
    end
    % jump here on break
end

if (is_n_prime==true)
    fprintf("%d is prime\n", n);
else
    fprintf("%d is not prime\n", n);
end
toc
