Fermat_v1.0

Fermat alg, console version, not fully tested