Read the API for the BigInteger class and see which methods suit your needs.
Post the code with your attempt if you have problems.
Ask a specific question if you have one, right now your question...