nextLargestPrime.frink

View or download nextLargestPrime.frink in plain text format


// Finds the smallest prime with n or more digits.

digits = eval[input["Enter number of digits: "]]

start = now[]
n = 10^(digits-1)+1

while(! isPrime[n])
   n = n + 2

println[n]
end = now[]

println["Total time is " + (end-start -> "s")]


View or download nextLargestPrime.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 17649 days, 5 hours, 40 minutes ago.