Like Fermat's proof of Fermat's Last Theorem, what this code actually is supposed to do is lost to history...
read more
import java.applet.Applet;
import java.awt.*;
//examine the lines in this data
public class tryValue extends Applet {
/**
* @param args
*/
Font bigFont;
Color redColor;
Color weirdColor;
Color bgColor;
int numberToGoUpTo = 10000;
int sizeOfBoxes = (1150/numberToGoUpTo);
//int sizeOfBoxes = 20;
boolean pairsThatWork [][]=new boolean[numberToGoUpTo][numberToGoUpTo];
public void init() {
this.setSize(1820, 1150);
for (int w = 1; w < numberToGoUpTo; w++) {
for (int y = 1; y < numberToGoUpTo; y++) {
for (int x = 1; x < numberToGoUpTo; x++) {
double sum = Math.pow(w, x) + Math.pow(y, x);
double z = Math.pow(sum, (1.0 / x));
if (z == Math.round(z) && (z != w && z != y) && (x != 1)) {
System.out.println("w:" + w + " y:" + y + " z:" + z
+ " x:" + x);
pairsThatWork[w][y]=true;
}
}
}
}
// Here we will define the varibles further
// Will use Arial as type, 16 as size and bold as style
// Italic and Plain are also available
bigFont = new Font("Arial", Font.BOLD, 16);
// Standard colors can be named like this
redColor = Color.red;
// lesser known colors can be made with R(ed)G(reen)B(lue).
weirdColor = new Color(60, 60, 122);
bgColor = Color.blue;
// this will set the backgroundcolor of the applet
}
public void stop() {
}
public void paint(Graphics g) {
for (int i = 1; i < numberToGoUpTo; i++) {
g.drawString(Integer.toString(i), sizeOfBoxes * i, sizeOfBoxes);
g.drawLine(sizeOfBoxes * i, sizeOfBoxes, sizeOfBoxes * i, 1000);
}
for (int i = 1; i < numberToGoUpTo; i++) {
// g.drawString(Integer.toString(i), 20*i, 20);
g.drawLine(sizeOfBoxes, sizeOfBoxes * i, 1800, sizeOfBoxes * i);
}
for (int i = 1; i < numberToGoUpTo; i++) {
g.drawString(Integer.toString(i), sizeOfBoxes, (sizeOfBoxes * i)
+ sizeOfBoxes);
}
for (int i = 1; i < numberToGoUpTo; i++) {
for (int a = 1; a < numberToGoUpTo; a++) {
if (pairsThatWork[i][a]) {
if(i>=a){
g.setColor(Color.red);}else{
g.setColor(Color.blue);
}
g.fillRect(sizeOfBoxes * i, sizeOfBoxes * a, sizeOfBoxes,
sizeOfBoxes);
g.setColor(Color.black);
if (Integer.toString(a).length() > 1) {
g.drawString(Integer.toString(a),
(sizeOfBoxes * i) + 2, (sizeOfBoxes * a) + 15);
} else {
g.drawString(Integer.toString(a),
(sizeOfBoxes * i) + 6, (sizeOfBoxes * a) + 15);
}
}
}
}
}
}