For just printing the values of Euler's phi function of integers n between 1 and 20 write: for(n=1, 20, print(n, " ", eulerphi(n))) For printing the values of Euler's phi function of primes n between 1 and 20 write: forprime(n=1, 20, print(n, " ", eulerphi(n))) For printing those n's between 1 and 20 for which phi(n) = n/2 write for(n=1, 20, if(eulerphi(n) == n/2, print(n, " ", eulerphi(n)),)) For checking how the ratio phi(n)/n behaves for n between 1 and 20 write for(n=1, 20, print(eulerphi(n)/n*1.0)) For checking how small phi(n)/n can get for n between 1 and 20 write the following (you can replace 20 by 10^7 without making PARI sweat) a = 1; for(n=1, 20, if(eulerphi(n)/n>a, , a = eulerphi(n)/n));print(a*1.0)