Extra primes: Difference between revisions

m
→‎{{header|Free Pascal}}: now with crossing 10th order of magnitude like in Raku
m (→‎{{header|Free Pascal}}: Free Pascal as sub category of Pascal)
m (→‎{{header|Free Pascal}}: now with crossing 10th order of magnitude like in Raku)
Line 1,990:
=={{header|Pascal}}==
==={{header|Free Pascal}}===
using simple circular buffer for last n solutions.With crossing 10th order of magnitude like in Raku.
<syntaxhighlight lang="pascal">
<syntaxhighlight lang="pascal">program SpecialPrimes;
// modified smarandache
{$IFDEF FPC}{$MODE DELPHI}{$OPTIMIZATION ON,ALL}{$ENDIF}
Line 2,001:
 
var
//circular listbuffer
Last64 : array[0..63] of Uint64;
cnt,Limit : NativeUint;
Line 2,010:
idx: Int32;
begin
idx := LastIdx-i-1;
whileIf idx < Low(Last64) dothen
idx += High(Last64)+1;
For i := i downto 1 do
begin
Line 2,081:
end
else
IF n >= Limit then
Begin
OutLast(7);
Line 2,128:
inc(LastIdx);
OutLast(7);
writeln('count: ',cnt);
end.</syntaxhighlight>
{{out|@TIO.RUN}}
Line 2,135 ⟶ 2,136:
2777, 3253, 3257, 3323, 3527, 3727, 5233, 5237, 5273, 5323,
5527, 7237, 7253, 7523, 7723, 7727,
7555775577 7557775773 7577377377 7737777557 7755777573 7757377773 77773222337
772537 772573 773273 773723 775237 775273 777277 2222333
7775533 7775737 7775753 7777337 7777537 7777573 7777753 22222223
7775323377755523 7775352777757257 7775552377757523 7775725777773277 7775752377773723 7777327777777327 77773723222222227
777773333777775373 777773753777775553 777775373777775577 777775553777777227 777775577777777577 777777227777777773 7777775772222222377
7777753253 7777772773 7777773257 7777773277 7777775273 7777777237 7777777327 22222222223
77777757377 77777757773 77777773537 77777773757 77777775553 77777777533 77777777573 {{77777272733 63 places before last}}
count: 107308
Real time: 46.241 s CPU share: 99.38 %
@home: Real time: 8.615 s maybe much faster div ( Ryzen 5600G 4.4 Ghz vs Xeon 2.3 Ghz)
132

edits