This is a problem from Project Euler, and this question includes some source code, so consider this your spoiler alert, in case you are interested in solving it yourself. It
Try using BigInteger type , 2^100 will end up to a a very large number for even double to handle.
type