Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
14
Task/Babbage-problem/Lua/babbage-problem.lua
Normal file
14
Task/Babbage-problem/Lua/babbage-problem.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
-- get smallest number <= sqrt(269696)
|
||||
k = math.floor(math.sqrt(269696))
|
||||
|
||||
-- if root is odd -> make it even
|
||||
if k % 2 == 1 then
|
||||
k = k - 1
|
||||
end
|
||||
|
||||
-- cycle through numbers
|
||||
while not ((k * k) % 1000000 == 269696) do
|
||||
k = k + 2
|
||||
end
|
||||
|
||||
io.write(string.format("%d * %d = %d\n", k, k, k * k))
|
||||
Loading…
Add table
Add a link
Reference in a new issue