static ArrayList<Triplet>  generateTriplets(int cap){
		//TODO: make primitive version (primitive if and only if m and n are coprime and m - n is odd)
		ArrayList<Triplet> list = new ArrayList<Triplet>();
		for(int m = 1; m*m < cap; m++){
			for(int n = 1; n < m; n++){
				int a = m*m-n*n;
				int b = 2*m*n;
				int c = m*m+n*n;
			  if(c > cap) break;
				list.add(new Triplet(a,b,c));
			}
		}
		Collections.sort(list);
		return list;
	}