static int func ( int ind , int g , int dp [ ] [ ] , int n , int a [ ] ) {
  if ( ind == n ) {
    if ( g == 1 ) return 1 ;
    else return 0 ;
  }
  if ( dp [ ind ] [ g ] != - 1 ) return dp [ ind ] [ g ] ;
  int ans = func ( ind + 1 , g , dp , n , a ) + func ( ind + 1 , gcd ( a [ ind ] , g ) , dp , n , a ) ;
  return dp [ ind ] [ g ] = ans ;
}

static int func ( int ind , int g , int dp [ ] [ ] , int n , int a [ ] ) { if ( ind == n ) { if ( g == 1 ) return 1 ; else return 0 ; } if ( dp [ ind ] [ g ] != - 1 ) return dp [ ind ] [ g ] ; int ans = func ( ind + 1 , g , dp , n , a ) + func ( ind + 1 , gcd ( a [ ind ] , g ) , dp , n , a ) ; return dp [ ind ] [ g ] = ans ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (return_statement (decimal_integer_literal)) alternative: (return_statement (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (return_statement (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier) (identifier) (identifier) (identifier))) right: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (method_invocation name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (identifier))) (identifier) (identifier) (identifier)))))) (return_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (identifier)))))