Skip to content

Conversation

smichr
Copy link
Member

@smichr smichr commented Apr 14, 2021

References to other Issues or PRs

close #19118

Brief description of what is fixed or changed

give primerange a single-arg option and document the use of prime to reference by index the desired number of primes to generate

>>> primerange(prime(10))  # up to 10th
[2, 3, 5, 7, 11, 13, 17, 19, 23]
>>> primerange(prime(10)+1)  # including the 10th
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]

Other comments

Release Notes

  • ntheory
    • primerange now accepts a single argument, a, which gives the range [2, a)

@sympy-bot
Copy link

sympy-bot commented Apr 14, 2021

Hi, I am the SymPy bot (v161). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

Your release notes are in good order.

Here is what the release notes will look like:

  • ntheory
    • primerange now accepts a single argument, a, which gives the range [2, a) (#21321 by @smichr)

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.9.

Click here to see the pull request description that was parsed.
<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234" (see
https://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->

close #19118 

#### Brief description of what is fixed or changed

give `primerange` a single-arg option and document the use of `prime` to reference by index the desired number of primes to generate
```python
>>> primerange(prime(10))  # up to 10th
[2, 3, 5, 7, 11, 13, 17, 19, 23]
>>> primerange(prime(10)+1)  # including the 10th
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
```
#### Other comments


#### Release Notes

<!-- Write the release notes for this release below between the BEGIN and END
statements. The basic format is a bulleted list with the name of the subpackage
and the release note for this PR. For example:

* solvers
  * Added a new solver for logarithmic equations.

* functions
  * Fixed a bug with log of integers.

or if no release note(s) should be included use:

NO ENTRY

See https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more
information on how to write release notes. The bot will check your release
notes automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
* ntheory
  * `primerange` now accepts a single argument, a,  which gives the range [2, a)
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

use `nth` instead of `ith` to match function arg and to avoid confusion with the next line of docstring
@smichr
Copy link
Member Author

smichr commented Apr 14, 2021

This adds functionality to function primerange that was already agreed upon for the sieve method with the same name.

@smichr smichr merged commit 2a23c00 into sympy:master Apr 14, 2021
@smichr smichr deleted the primerange branch April 14, 2021 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generating first n prime numbers
3 participants