Generate the largest Prime Number
|
02-07-2018, 07:33 PM
(This post was last modified: 02-07-2018 07:35 PM by Dieter.)
Post: #5
|
|||
|
|||
RE: Generate the largest Prime Number
(02-07-2018 09:26 AM)Gamo Wrote: The highest prime number that fill 10 digits calculator screen is 9,999,999,997 I assume the last line is supposed to read 1000000010 R/S result 3 > 10,000,000,103 Now, what do you want to get if you enter a 10-digit number like 1.000.000.001? - The next prime with 11 digits? That's 10.000.000.019, so the output is 9 ? This means: determine the next prime after 10*x. - The next prime with 12 digits? That's 100.000.000.103, so the output is 03 ? This means: determine the next prime after 100*x. - The next prime with 13 digits? That's 1.000.000.001.051, so the output is 051 ? This means: determine the next prime after 1000*x. Let's assume you mean the first case. "Determine the next prime" here simply means: Check if the following numbers are prime: 10*x+1, 10*x+3, 10*x+7 and 10*x+9 So it boils down to an algorithm like this: Code: input x Now, how do you check if an 11-digit number is divisible by, say, 7 while all you got is a 10-digit calculator? I'd say this can be done. Think hard. ;-) Dieter |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Generate the largest Prime Number - Gamo - 02-06-2018, 03:05 AM
RE: Generate the largest Prime Number - Dieter - 02-06-2018, 08:04 PM
RE: Generate the largest Prime Number - Gamo - 02-07-2018, 12:34 AM
RE: Generate the largest Prime Number - Gamo - 02-07-2018, 09:26 AM
RE: Generate the largest Prime Number - Dieter - 02-07-2018 07:33 PM
|
User(s) browsing this thread: 4 Guest(s)