Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the paper that is_extra_strong_lucas_prp is referring to? #443

Closed
haru-44 opened this issue Oct 25, 2023 · 4 comments
Closed

What is the paper that is_extra_strong_lucas_prp is referring to? #443

haru-44 opened this issue Oct 25, 2023 · 4 comments

Comments

@haru-44
Copy link

haru-44 commented Oct 25, 2023

The is_extra_strong_lucas_prp is described as follows:

gmpy/src/gmpy_mpz_prp.c

Lines 953 to 959 in ac1e151

/* *******************************************************************************************
* mpz_extrastronglucas_prp:
* Let U_n = LucasU(p,1), V_n = LucasV(p,1), and D=p^2-4.
* An "extra strong Lucas probable prime" to the base p is a composite n = (2^r)*s+(D/n), where
* s is odd and (n,2D)=1, such that either U_s == 0 mod n or V_s == +/-2 mod n, or
* V_((2^t)*s) == 0 mod n for some t with 0 <= t < r-1 [(D/n) is the Jacobi symbol]
* *******************************************************************************************/

On the other hand, the paper defines extra strong Lucas pseudoprime as follows

An extra strong Lucas pseudoprime ... such that either $U_s \equiv 0 \bmod n$ and $V_s \equiv \pm 2 \bmod n$, or $V_{2^ts} \equiv 0 \bmod n$ ...

The U_s and V_s are and conditions, not or.
The same definition applies to sympy and OEIS.

Is there any references that define extra strong Lucas pseudoprime with or condition? If not, is it a bug?

sympy/sympy#25826

@smichr
Copy link

smichr commented Oct 25, 2023

Grammatically, it seems like the statement in the docstring is wrong since a series of or statements would be written as "such that either this, or this, or this" while what is written is "such that either this or this, or this" (suggesting that it is actually "such that either this and this, or this").

@casevh
Copy link
Collaborator

casevh commented Oct 26, 2023 via email

@casevh
Copy link
Collaborator

casevh commented Oct 26, 2023

I've committed the fix.

@haru-44
Copy link
Author

haru-44 commented Oct 26, 2023

Thank you for the fix.

@haru-44 haru-44 closed this as completed Oct 26, 2023
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

No branches or pull requests

3 participants