Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,22 +0,0 @@
with Ada.Text_IO;
with Ada.Command_Line;
procedure Factors is
Number : Positive;
Test_Nr : Positive := 1;
begin
if Ada.Command_Line.Argument_Count /= 1 then
Ada.Text_IO.Put (Ada.Text_IO.Standard_Error, "Missing argument!");
Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
return;
end if;
Number := Positive'Value (Ada.Command_Line.Argument (1));
Ada.Text_IO.Put ("Factors of" & Positive'Image (Number) & ": ");
loop
if Number mod Test_Nr = 0 then
Ada.Text_IO.Put (Positive'Image (Test_Nr) & ",");
end if;
exit when Test_Nr ** 2 >= Number;
Test_Nr := Test_Nr + 1;
end loop;
Ada.Text_IO.Put_Line (Positive'Image (Number) & ".");
end Factors;

View file

@ -1,13 +0,0 @@
;AutoIt Version: 3.2.10.0
$num = 45
MsgBox (0,"Factors", "Factors of " & $num & " are: " & factors($num))
consolewrite ("Factors of " & $num & " are: " & factors($num))
Func factors($intg)
$ls_factors=""
For $i = 1 to $intg/2
if ($intg/$i - int($intg/$i))=0 Then
$ls_factors=$ls_factors&$i &", "
EndIf
Next
Return $ls_factors&$intg
EndFunc

View file

@ -1,40 +0,0 @@
IDENTIFICATION DIVISION.
PROGRAM-ID. FACTORS.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 CALCULATING.
03 NUM USAGE BINARY-LONG VALUE ZERO.
03 LIM USAGE BINARY-LONG VALUE ZERO.
03 CNT USAGE BINARY-LONG VALUE ZERO.
03 DIV USAGE BINARY-LONG VALUE ZERO.
03 REM USAGE BINARY-LONG VALUE ZERO.
03 ZRS USAGE BINARY-SHORT VALUE ZERO.
01 DISPLAYING.
03 DIS PIC 9(10) USAGE DISPLAY.
PROCEDURE DIVISION.
MAIN-PROCEDURE.
DISPLAY "Factors of? " WITH NO ADVANCING
ACCEPT NUM
DIVIDE NUM BY 2 GIVING LIM.
PERFORM VARYING CNT FROM 1 BY 1 UNTIL CNT > LIM
DIVIDE NUM BY CNT GIVING DIV REMAINDER REM
IF REM = 0
MOVE CNT TO DIS
PERFORM SHODIS
END-IF
END-PERFORM.
MOVE NUM TO DIS.
PERFORM SHODIS.
STOP RUN.
SHODIS.
MOVE ZERO TO ZRS.
INSPECT DIS TALLYING ZRS FOR LEADING ZERO.
DISPLAY DIS(ZRS + 1:)
EXIT PARAGRAPH.
END PROGRAM FACTORS.

View file

@ -1,8 +0,0 @@
iter factors(n) {
for i in 1..floor(sqrt(n)):int {
if n % i == 0 then {
yield i;
yield n / i;
}
}
}

View file

@ -1,3 +0,0 @@
function Get-Factor ($a) {
1..$a | Where-Object { $a % $_ -eq 0 }
}

View file

@ -1,6 +0,0 @@
function Get-Factor ($a) {
1..[Math]::Sqrt($a) `
| Where-Object { $a % $_ -eq 0 } `
| ForEach-Object { $_; $a / $_ } `
| Sort-Object -Unique
}

View file

@ -1,5 +1,5 @@
-- 22 Mar 2025
include Settings
-- 23 Aug 2025
include Setting
say 'FACTORS OF AN INTEGER'
say version
@ -21,6 +21,4 @@ end
say Format(Time('e'),,3) 'seconds'; say
exit
include Functions
include Sequences
include Abend
include Math

View file

@ -1,2 +1,2 @@
Factors ← ◴⊂⟜(⇌÷)⊸(▽:⟜≡(=0◿)⊙¤⊸(↘1⇡+1⌊√))
Factors ← ◴⊂⟜(⇌÷)⊸(▽≡(=0◿)⊙¤⊸(↘1⇡+1⌊√))
⍚Factors {45 53 64}