find the largest perfect number less than $10,000$ in Maple Can anyone tell me how to find largest perfect number less than 10000 in maple? 
Actually, I know how to find all the perfect numbers less than or equal to 10000 but I don't know how to find the largest one within the same code?

You could use the fact that all known perfect numbers are of the form $n=2^{p-1}(2^p-1)$ where $2^p-1$ is a prime (and hence $p$ is a prime.) 
This means that $2n=(2^p)^2-2^p = (2^p-\frac{1}{2})^2-1/4$. So $2^{p}-1$ only needs to be checked up to the value of $\sqrt{20000}\approx 142$, or $p$ only needs to be checked up to  $p=7$. Indeed, $127=2^7-1$ is prime, so $2^{6}(2^7-1)=8128$ is the perfect number you are looking for.
