Here are two more-efficient algorithms for the sum of the proper divisors. The first of these (**SPD2** below) is much faster than your original; the second (**SPD3** below) is much faster than that.

I think that this will all work in your Maple 13; if not, let me know.

**restart
:
(* Sum of Proper Divisors (original version):
---------------------------------------------
This is your original procedure. The only changes I made were removing things
not directly related to getting the answer, such as print statements.
*)
SPD0:= proc(n)
local Sum1, b;
Sum1:= 1;
for b from 2 to ceil(n/2) do
if floor(n/b) = n/b then Sum1:= Sum1 + b fi
od;
Sum1
end proc
:
(* Sum of Proper Divisors (version 1):
--------------------------------------
This is the same algorithm as yours, recoded. The changes that I made were
to use operators that are more efficient for integer arithmetic: add, modp,
and iquo instead of `for`, ceil, `/`, and floor.
*)
SPD1:= proc(n::posint)
local d;
1 + add(`if`(modp(n,d) = 0, d, 0), d= 2..iquo(n,2))
end proc
:
(* Sum of Proper Divisors (version 2):
--------------------------------------
This algorithm uses this idea:
Let n be a positive integer. Let s = floor(sqrt(n)). For every divisor d of n,
q = n/d is also a divisor, and d <= s iff q >= s. If s^2 = n, we need to adjust
for the double counting of s.
*)
SPD2:= proc(n::posint)
local d, q, s;
s:= isqrt(n); #same as floor(sqrt(n)) but faster
#irem gives the integer remainder and quotient in one step:
add(`if`(irem(n, d, 'q') = 0, d+q, 0), d= 2..s) + 1 - `if`(s^2=n, s, 0)
end proc
:
(* Sum of Divisors of a Prime Power:
------------------------------------
For prime p, the divisors of p^e are clearly
{1, p, p^2, ..., p^e}.
The sum of those is a simple geometric sum:
sum(p^k, k= 0..e) = (p^(e+1) - 1)/(p - 1).
*)
SDPP:= (p::prime, e::posint)-> (p^(e+1) - 1)/(p-1)
:
(* Sum of Proper Divisors (version 3):
--------------------------------------
This uses the classic formula for the sum of divisors, then subtracts
the number itself.
This uses ifactors, which returns the same information as ifactor, but in a
list of lists format:
ifactors(n) = [-1 or +1, [[p1,e1], [p2,e2], ..., [pk,ek]]],
such that the prime factorization is
n = p1^e1 * p2^e2 * ... * pk^ek.
*)
SPD3:= proc(n::posint)
local P;
mul(SDPP(P[]), P= ifactors(n)[2]) - n
end proc
:
#Test all 4 on your example:
SPD||(0..3)(945);**
975, 975, 975, 975
**#Construct a much larger random example:
seq('rand(2..99)(), nextprime(rand(10^5..10^7)())', k= 1..9);**
94, 8633311, 97, 9909901, 60, 1584343, 70, 3888067, 97, 3079871,
91, 5954371, 19, 8014679, 57, 682901, 84, 4397777
**n:= `*`(%);**
n := 7153933542604628643414930949912947237856549377795642829298491576067369227200
**CodeTools:-Usage( SPD3(n) );**
memory used=9.62MiB, alloc change=0 bytes,
cpu time=94.00ms, real time=160.00ms, gc time=0ns
28515792740732679749844128611744262891259901154773757373417700467974788852800