Zumkeller numbers: Difference between revisions

m
→‎{{header|Pascal}}: too much copy and paste...
m (→‎{{header|Pascal}}: using prime decomposition is much faster)
m (→‎{{header|Pascal}}: too much copy and paste...)
Line 2,773:
 
tprimeFac = record
pfPrims : array[0..1513] of tPot;
pfSumOfDivs :Uint64;
pfCnt,
Line 2,832:
procedure PrimeDecomposition(n:Uint32;var res:tprimeFac);
var
DivSum,fac:Uint64;
i,pr,cnt,DivCnt,quot{to minimize divisions} : NativeUint;
Begin
Line 2,978:
hs1 := @hs0[i];
For j := maxlimit downto 0 do
hs1[j] := hs1[j] OR hs0[j];
maxlimit += i;
end;
Line 3,090:
setlength(HasSum, 0);
{$IFNDEF UNIX} readln; {$ENDIF}
end.</lang>
 
</lang>
{{out}}
<pre>TIO.RUN
 
The first 220 zumkeller numbers
6 12 20 24 28 30 40 42 48 54 56 60 66 70 78 80 84 88 90 96
Line 3,114 ⟶ 3,115:
 
The first odd 40 zumkeller numbers not ending in 5
81081 153153 171171 189189 207207 223839 243243 261261 279279 297297 351351
351351 459459 513513 567567 621621 671517 729729 742203 783783 793611 812889
812889 837837 891891 908523 960687 999999 1024947 1054053 1072071 1073709 1095633
1095633 1108107 1145529 1162161 1198197 1224531 1270269 1307691 1324323 1378377 1432431
 
runtime 0.473441 s
 
Real time: 0.620579 s User time: 0.568533 s Sys. time: 0.048042 sCPUs CPU share: 99.3141 %
</pre>
 
Anonymous user