RosettaCodeData/Task/Primorial-numbers/Lingo/primorial-numbers.lingo
2023-07-01 13:44:08 -04:00

22 lines
458 B
Text

-- libs
sieve = script("math.primes").new()
bigint = script("bigint").new()
cnt = 1000 * 100
primes = sieve.getNPrimes(cnt)
pr = 1
put "Primorial 0: " & pr
repeat with i = 1 to 9
pr = pr*primes[i]
put "Primorial " & i & ": " & pr
end repeat
pow10 = 10
repeat with i = 10 to cnt
pr = bigint.mul(pr, primes[i])
if i mod pow10=0 then
put "Primorial " & i & " has length: " & pr.length
pow10 = pow10 * 10
end if
end repeat