Add almost prime example.

This is a translation from the C code.