Problem statement
Given two positive integers n and Δ, write a function which computes the frequency of the gap Δ between two consecutive of the primes in the prime vector going from 2 to n.
Examples
- For n = 100 and Δ= 2, your function should return f = 1/3 since one third of the prime gaps between 2 and 97 equal Δ;
- For n = 1000 and Δ= 6, your function should return f = 44/167;
See also
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Group
Problem Recent Solvers25
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
For a related problem, see #46582.
Thank you for the reference Chris.