Skip to content

prime_range should allow a step #29760

@kedlaya

Description

@kedlaya

Is there any reason not to implement the following?

sage: prime_range(11, 100, 10)
[11, 31, 61, 71]

For this ticket, I have in mind the easy fix of running the same internal algorithm and retaining only the answers in the desired congruence class; that is, prime_range(x, y, z) would be equivalent to

[p for p in prime_range(x, y) if (p-x)%z == 0]

A more advanced (and more efficient) version would be to change the underlying algorithm.

Depends on #31548

CC: @DaveWitteMorris

Component: number theory

Author: David Roe

Branch/Commit: u/roed/prime_range @ 7f0a385

Issue created by migration from https://trac.sagemath.org/ticket/29760

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions