Skip to content

Commit

Permalink
Update README for June 2021
Browse files Browse the repository at this point in the history
  • Loading branch information
justone committed Jun 10, 2021
1 parent 88feee4 commit 3e44a66
Showing 1 changed file with 40 additions and 8 deletions.
48 changes: 40 additions & 8 deletions la-meetup-june-2021/README.md
@@ -1,21 +1,53 @@
## {{Name of Challenge}}
## Prime Gaps

Sourced from {{URL}}
Sourced from <https://edabit.com/challenge/FEK7892zgj4nPJvkE>


{{Description}}
A prime gap of length n is a run of n-1 consecutive composite numbers between two successive primes. See this Resource for more information.

The prime numbers are not regularly spaced. For example gap between:

## Examples
* 2 and 3 is 1
* 3 and 5 is 2
* 7 and 11 is 4

Create a function with following parameters:

```
g (integer >= 2)
# Gap between the consecutive primes
a (integer > 2)
# Start of the search (a inclusive)
b (integer >= a)
# End of the search (b inclusive)
```
{{Examples}}

... and returns the first pair of two prime numbers spaced with a gap of g between the limits a and b.

```
prime_gaps(2, 3, 50) ➞ [3, 5]
# Between 2 and 50 we have the following pairs of 2-gaps primes:
# 3-5, 5-7, 11-13, 17-19, 29-31, 41-43.
# [3, 5] is the first pair between 3 and 50 with a 2-gap.
```

### Examples

```
prime_gaps(2, 5, 7) ➞ [5, 7]
prime_gaps(2, 5, 5) ➞ None
prime_gaps(4, 130, 200) ➞ [163, 167]
```

## Notes
Notes

- {{Note1}
- {{Note2}
Return None if consecutive prime numbers are not found with the required gap.

## Commands

Expand Down

0 comments on commit 3e44a66

Please sign in to comment.