Question
In Python programming language, As we go farther out on the number line prime numbers become rarer. This is the end of the list of
In Python programming language,
As we go farther out on the number line prime numbers become rarer. This is the end of the list of primes less than 10,000:
... 9923, 9929, 9931, 9941, 9949, 9967, 9973]
There's a twin pair there -- (9929, 9931) -- but in general the distance between primes is getting larger and larger. If we look at the entire list of primes less than 10,000 we'd find that the largest gap is 36, which is the distance between 9551 and 9587.
Fill in the body of the function named largest gap so that it finds the size the largest difference between two successive numbers in a list.
Example: from the list of primes less than 50 we can see the largest gap is 6, which is between 23 and 29
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started