Closed haru-44 closed 10 months ago
For lucasu_mod and lucasv_mod, it seems to be acceptable to input k=0 according to the description.
lucasu_mod
lucasv_mod
k=0
https://github.com/aleaxit/gmpy/blob/125310619ffc3cbf2a88a3b9121ea74b8e295ec3/src/gmpy_mpz_lucas.c#L185-L188
However, it does not seem to be expected that k=0 is actually input.
Same for lucasu/v, they just spin forever.
Since it looks like it works for k>0, I'll just check for k==0 and return the correct value.
For reference, see https://en.wikipedia.org/wiki/Lucas_sequence
For
lucasu_mod
andlucasv_mod
, it seems to be acceptable to inputk=0
according to the description.https://github.com/aleaxit/gmpy/blob/125310619ffc3cbf2a88a3b9121ea74b8e295ec3/src/gmpy_mpz_lucas.c#L185-L188
However, it does not seem to be expected that
k=0
is actually input.