Backup of code I wrote to calculate patterns between prime numbers.

``````
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Scanner;

/**
* @param args
*/
public static void main(String[] args) throws FileNotFoundException {
// TODO Auto-generated method stub
File file = new File("/Users/Puccio/Desktop/PRIMES1T.TXT");
Scanner primesArray = new Scanner(file);
ArrayList primes = new ArrayList();
ArrayList allPrimes = new ArrayList();
for (int i = 0; i < 1000; i++) {
}

for (int i = 1; i < 10; i++) {
int currentPrime = i; //You can change this to (Integer) allPrimes.get(i); if you want to start from primes
System.out.print(currentPrime + " You can add ");
for (int a = 2; a < currentPrime; a++) {
int cantAdd= a - (currentPrime % a);

}

}

HashSet hs = new HashSet();
/**
for (int p = 0; p < numbersYouCantAdd.size(); p++) {
if (p != numbersYouCantAdd.size() - 1) {
System.out.print(" or ");
}

}
*/
for(int y = 1; y<currentPrime;y++){
}
}
if (d != whatYouCanAdd.size() - 1) {
System.out.print(" or ");
}
}

}

System.out.println();

}
HashSet hs = new HashSet();
primes.clear();
Collections.sort(primes);
System.out.println(primes);

}

}
``````