Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
14
Task/Arithmetic-Rational/Elisa/arithmetic-rational-2.elisa
Normal file
14
Task/Arithmetic-Rational/Elisa/arithmetic-rational-2.elisa
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
use RationalNumbers;
|
||||
|
||||
PerfectNumbers( Limit = integer) -> multi(integer);
|
||||
PerfectNumbers( Limit) =
|
||||
[ Candidate = 2 .. Limit;
|
||||
Sum:= Rational(1,Candidate);
|
||||
[ Divisor = 2 .. integer(sqrt(real(Candidate)));
|
||||
if mod(Candidate, Divisor) == 0 then
|
||||
Sum := Sum + Rational(1, Divisor) + Rational(Divisor, Candidate);
|
||||
];
|
||||
if Sum == Rational(1,1) then Candidate
|
||||
];
|
||||
|
||||
PerfectNumbers(10000)?
|
||||
Loading…
Add table
Add a link
Reference in a new issue