Sequence: smallest number greater than previous term with exactly n divisors: Difference between revisions

Content added Content deleted
(Added Algol W)
Line 200: Line 200:
integer procedure countDivisors ( Integer value n ) ;
integer procedure countDivisors ( Integer value n ) ;
begin
begin
integer count, i;
integer count, i, i2;
count := 0;
count := 0;
i := 1;
i := 1;
while i * i < n do begin
while begin i2 := i * i;
i2 < n
end do begin
if n rem i = 0 then count := count + 2;
if n rem i = 0 then count := count + 2;
i := i + 1
i := i + 1
end;
end;
if i * i = n then count + 1 else count
if i2 = n then count + 1 else count
end countDivisors ;
end countDivisors ;