I actually wrote a small java program to find example(s): import java.math.BigInteger; public class ASQ105 { static BigInteger one = new BigInteger("1"); static BigInteger three = new BigInteger("3"); static BigInteger seven = new BigInteger("7"); public static void main (String args[]) throws java.io.IOException { String sInput; char ch; StringBuffer sbInput = new StringBuffer(); while (Character.isDigit(ch=(char)System.in.read())) sbInput.append(ch); while (ch!='\n') ch=(char)System.in.read(); sInput=sbInput.toString(); BigInteger a = new BigInteger(sInput); do { System.out.print(a.toString() + '\r'); BigInteger b = new BigInteger("0"); for (b=one; b.compareTo(a)<=0; b=b.add(one)) { if ((a.add(b)).multiply(seven).compareTo(((a.multiply(a)).add(b.multiply(b)).subtract(a.multiply(b))).multiply(three)) == 0) System.out.println(a.toString() + '\t' + b.toString()); } a = a.add(one); } while (true); } }