private static boolean hasConsecutivePrimes ( int n ) {
  long n2 = ( long ) n * n ;
  long [ ] temp = new long [ INCREMENTS . length ] ;
  for ( int i = 0 ;
  i < INCREMENTS . length ;
  i ++ ) temp [ i ] = n2 + INCREMENTS [ i ] ;
  for ( int p : primes ) {
    for ( long x : temp ) {
      if ( x != p && x % p == 0 ) return false ;
    }
  }
  for ( int i = 1 ;
  i < INCREMENTS [ INCREMENTS . length - 1 ] ;
  i ++ ) {
    if ( Arrays . binarySearch ( INCREMENTS , i ) < 0 && isPrime ( n2 + i ) ) return false ;
  }
  return true ;
}

private static boolean hasConsecutivePrimes ( int n ) { long n2 = ( long ) n * n ; long [ ] temp = new long [ INCREMENTS . length ] ; for ( int i = 0 ; i < INCREMENTS . length ; i ++ ) temp [ i ] = n2 + INCREMENTS [ i ] ; for ( int p : primes ) { for ( long x : temp ) { if ( x != p && x % p == 0 ) return false ; } } for ( int i = 1 ; i < INCREMENTS [ INCREMENTS . length - 1 ] ; i ++ ) { if ( Arrays . binarySearch ( INCREMENTS , i ) < 0 && isPrime ( n2 + i ) ) return false ; } return true ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (cast_expression type: (integral_type) value: (identifier)) right: (identifier)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (field_access object: (identifier) field: (identifier)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (block (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))) consequence: (return_statement (false))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal)))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))) right: (decimal_integer_literal)) right: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)))))) consequence: (return_statement (false))))) (return_statement (true))))