Did you know? SWI-Prolog supports arbitrarily large integersSearch Documentation:
SWI-Prolog owl logoPredicate flatten/2