aprime1 - % d = 2; for i=d:m-1 y = mod(m,d); end if y == 0...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function x = aprime(m); % if m is prime number, yes x = 1, no x=0 % m = any integer > 2
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % d = 2; for i=d:m-1 y = mod(m,d); end if y == 0 disp('0'); else disp('1'); end...
View Full Document

This note was uploaded on 03/15/2011 for the course COM S 100 at Cornell University (Engineering School).

Ask a homework question - tutors are online