static void nthprimedigitsnumber ( long n ) {
  long len = 1 ;
  long prev_count = 0 ;
  while ( true ) {
    long curr_count = ( long ) ( prev_count + pow ( 4 , len ) ) ;
    if ( prev_count < n && curr_count >= n ) break ;
    len ++ ;
    prev_count = curr_count ;
  }
  for ( int i = 1 ;
  i <= len ;
  i ++ ) {
    for ( long j = 1 ;
    j <= 4 ;
    j ++ ) {
      if ( prev_count + pow ( 4 , len - i ) < n ) prev_count += pow ( 4 , len - i ) ;
      else {
        if ( j == 1 ) System . out . print ( "2" ) ;
        else if ( j == 2 ) System . out . print ( "3" ) ;
        else if ( j == 3 ) System . out . print ( "5" ) ;
        else if ( j == 4 ) System . out . print ( "7" ) ;
        break ;
      }
    }
  }
  System . out . println ( ) ;
}

static void nthprimedigitsnumber ( long n ) { long len = 1 ; long prev_count = 0 ; while ( true ) { long curr_count = ( long ) ( prev_count + pow ( 4 , len ) ) ; if ( prev_count < n && curr_count >= n ) break ; len ++ ; prev_count = curr_count ; } for ( int i = 1 ; i <= len ; i ++ ) { for ( long j = 1 ; j <= 4 ; j ++ ) { if ( prev_count + pow ( 4 , len - i ) < n ) prev_count += pow ( 4 , len - i ) ; else { if ( j == 1 ) System . out . print ( "2" ) ; else if ( j == 2 ) System . out . print ( "3" ) ; else if ( j == 3 ) System . out . print ( "5" ) ; else if ( j == 4 ) System . out . print ( "7" ) ; break ; } } } System . out . println ( ) ; }
(method_declaration (modifiers) type: (void_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: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (true)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (cast_expression type: (integral_type) value: (parenthesized_expression (binary_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (break_statement)) (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (identifier) right: (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: (identifier)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (identifier) right: (identifier))))) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (identifier) right: (identifier)))))) alternative: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))))))) (break_statement))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list)))))