16 lines
387 B
Text
16 lines
387 B
Text
local int = require "int"
|
|
local fmt = require "fmt"
|
|
|
|
local count = 0
|
|
local limit = 62
|
|
local n = 49
|
|
local deceptive = {}
|
|
while count < limit do
|
|
if !int.isprime(n) and n % 3 != 0 and n % 5 != 0 and int.modpow(10, n-1, n) == 1 then
|
|
deceptive:insert(n)
|
|
count += 1
|
|
end
|
|
n += 2
|
|
end
|
|
print($"The first {limit} deceptive numbers are:")
|
|
fmt.tprint("%5d ", deceptive, 9)
|