Calmo numbers: Difference between revisions

No edit summary
Line 399:
 
<syntaxhighlight lang="Delphi">
 
function GetAllProperDivisors(N: Integer;var IA: TIntegerDynArray): integer;
{Make a list of all the "proper dividers" for N}
{Proper dividers are the of numbers the divide evenly into N}
var I: integer;
begin
SetLength(IA,0);
for I:=1 to N-1 do
if (N mod I)=0 then
begin
SetLength(IA,Length(IA)+1);
IA[High(IA)]:=I;
end;
Result:=Length(IA);
end;
 
 
var Facts: TIntegerDynArray;
Line 408 ⟶ 424:
Result:=False;
{Get all divisors}
GetAllDivisorsGetAllProperDivisors(N,Facts);
{strip off 1 and N }
Facts:=Copy(Facts,1,High(Facts)-1);
if Length(Facts)<3 then exit;
{Must be at least three}
Line 463 ⟶ 479:
 
</pre>
 
 
 
=={{header|FutureBasic}}==
465

edits