Bodigrim / arithmoi

Number theory: primes, arithmetic functions, modular computations, special sequences
http://hackage.haskell.org/package/arithmoi
MIT License
147 stars 40 forks source link

Incorrect factorisation #221

Closed Sylardoom closed 11 months ago

Sylardoom commented 1 year ago

Hello

I don't know if this is the proper way to report this bug.

Solving Euler Project Problem #833, I found several numbers with an incorrect factorisation:

factorise 623506907396924300595652906937 [(Prime 300137,1),(Prime 1746779,1),(Prime 825131,1)] factorise 626472835738582668418814215862 [(Prime 2,1),(Prime 150211,1),(Prime 122939,1),(Prime 11746151,1)] factorise 638396704483535474833679624037 [(Prime 3,1),(Prime 11,2),(Prime 100519,1),(Prime 104281,1),(Prime 1268419,1)]

This happens with arithmoi version 0.12.0.2, but with arithmoi version 0.10.0 the result is correct:

factorise 623506907396924300595652906937 [(Prime 300137,1),(Prime 825131,2),(Prime 1746779,2)] factorise 626472835738582668418814215862 [(Prime 2,1),(Prime 150211,1),(Prime 11746151,2),(Prime 122939,2)] factorise 638396704483535474833679624037 [(Prime 3,1),(Prime 11,2),(Prime 100519,1),(Prime 104281,2),(Prime 1268419,2)]

Regards

Bodigrim commented 1 year ago

Wow, thanks! That's very embarassing: the bug lurked since arithmoi-0.7, and your examples work in arithmoi-0.10 only because of slightly different random numbers.

I've uploaded a fix as arithmoi-0.12.1.0, please give it a try.