Hi, out of curiosity I decided to do a naive "port" of the algorithm to use [https://github.com/def-/nim-bigints](https://github.com/def-/nim-bigints)
Apart from the fact that doing that I ran into an issue with bigints ([https://github.com/def-/nim-bigints/issues/27](https://github.com/def-/nim-bigints/issues/27)) the result ([https://play.nim-lang.org/#ix=2lU5](https://play.nim-lang.org/#ix=2lU5)) works and on my machine compiled with `-d:danger` it takes a bit more than 500ms. It might also be interesting to use [https://github.com/status-im/nim-stint](https://github.com/status-im/nim-stint) instead of bigints.
