Function to store and check the factors
static boolean findFactor ( int value , HashSet < Integer > factors ) { factors . add ( value ) ; for ( int i = 2 ; i * i <= value ; i ++ ) { if ( value % i == 0 ) {