Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
12
Task/Arithmetic-Rational/Pluto/arithmetic-rational.pluto
Normal file
12
Task/Arithmetic-Rational/Pluto/arithmetic-rational.pluto
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
local int = require "int"
|
||||
require "rat"
|
||||
|
||||
local one <const> = rat.of(1)
|
||||
print("The following numbers (less than 2^19) are perfect:")
|
||||
for i = 2, (1 << 19) - 1 do
|
||||
local sum = rat.of(1, i)
|
||||
local divs = int.divisors(i, true)
|
||||
divs:remove(1)
|
||||
for divs as j do sum += rat.of(1, j) end
|
||||
if sum == one then print($" {i}") end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue