// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class SqrtFun {
    private static final int[] SQ = { 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484 };
    public static void resolve(int n) {
        for(int i = SQ.length - 1; i >= 0; i--) {
            if(n % SQ[i] == 0) {
                System.out.println(n + "^0.5 = " + (i+1) + "*" + (n/SQ[i]) + "^0.5");
                return;
            }
        }
    }
    public static void main(String[] args) {
        for(int i = 1; i <= 1000; i++) {
            resolve(i);
        }
    }
}
