Project Euler code: Java, Python, C++