I am having a great deal of difficulty with this exercise.
>irem(floor(evalf(K*10^n,N)),10) can be used to find the nth digits of the decimal expansion of K
A given process.
The following procedure P(n) counts the number of prime numbers ≤ n.
> P:=proc(n) local c,i;
c:=0; # initialize the counter c=0
for i from 1 to n do
if type(i,prime) then c:=c+1;
end if; # increase c by 1 if i is prime
c; # output c