Jump to content

Totient function: Difference between revisions

m
No edit summary
Line 342:
COMMENT - EXERCISE THE FUNCTION;
INTEGER N, TOTIENT, COUNT;
WRITE(" N N PHI(N) PRIME?");
FOR N := 1 STEP 1 UNTIL 25 DO
BEGIN
Line 349:
END;
 
COMMENT - AND USE IT TO COOUNTCOUNT PRIMES;
WRITE("");
COUNT := 0;
Line 367:
Limiting the search to 1000 keeps the running time of the program within reasonable bounds.
<pre>
N N PHI(N) PRIME?
1 1 NO
2 1 YES
Line 397:
PRIMES UP TO 1000 = 168
</pre>
 
 
 
=={{header|APL}}==
211

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.