public static void calc ( long i ) {
  if ( i > cons ) {
    return ;
  }
  String [ ] temp = Long . toString ( i ) . split ( "" ) ;
  long s = 0 ;
  long f = 0 ;
  for ( String x : temp ) {
    if ( x . equals ( "4" ) ) {
      f ++ ;
    }
    else {
      s ++ ;
    }
  }
  if ( i >= n && s == f ) {
    arr . add ( i ) ;
  }
  calc ( ( i * 10 ) + 4 ) ;
  calc ( ( i * 10 ) + 7 ) ;
}

public static void calc ( long i ) { if ( i > cons ) { return ; } String [ ] temp = Long . toString ( i ) . split ( " " ) ; long s = 0 ; long f = 0 ; for ( String x : temp ) { if ( x . equals ( "4" ) ) { f ++ ; } else { s ++ ; } } if ( i >= n && s == f ) { arr . add ( i ) ; } calc ( ( i * 10 ) + 4 ) ; calc ( ( i * 10 ) + 7 ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (return_statement))) (local_variable_declaration type: (array_type element: (type_identifier) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list (string_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (enhanced_for_statement type: (type_identifier) name: (identifier) value: (identifier) body: (block (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) consequence: (block (expression_statement (update_expression (identifier)))) alternative: (block (expression_statement (update_expression (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)))))))