Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class xplusnthing{
- public static void main(String[] args){
- int iMax = 100;
- for(int i = 0; i<iMax; i++){
- for(int j = 0; j<i; j++){
- int a = i-j;
- int b = i+j;
- int c = a*b;
- int d = (int) Math.floor(Math.sqrt(c));
- int e = c-(d*d);
- int f = (2*d) + 1 - e;
- int n = i - d;
- int x = d - a;
- int nminusone = n - 1;
- int xplusn = x + n;
- if(xplusn == 11){
- System.out.println("{" + e + "," + n + "," + d + "," + x + "," + a + "," + b + "}\t(x+n): " + xplusn + "\tf = " + f + "\td = " + d + "\tn-1 = " + nminusone);
- }
- }
- }
- }
- public static boolean isPrime(int n) {
- if (n == 1 || n == 4 || n < 1) {
- return false;
- }
- for (int i = 2; i < (n/2); i++) {
- if (n % i == 0) {
- return false;
- }
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment