Project Euler #36 Solution (Java)