public int nextPrime() { int n= a[index]+1; while(true) { boolean b = true; for(int i=0 ; i