static int findOnBulbs ( int numberOfBulbs ) {
  int onBulbs = 0 ;
  int bulb = 1 ;
  int person = 1 ;
  for ( bulb = 1 ;
  bulb <= numberOfBulbs ;
  bulb ++ ) {
    int factors = 0 ;
    for ( person = 1 ;
    person * person <= numberOfBulbs ;
    person ++ ) {
      if ( bulb % person == 0 ) {
        factors ++ ;
        if ( bulb / person != person ) {
          factors ++ ;
        }
      }
    }
    if ( factors % 2 == 1 ) {
      System . out . println ( "Light bulb " + bulb + " will be on" ) ;
      onBulbs ++ ;
    }
  }
  return onBulbs ;
}

static int findOnBulbs ( int numberOfBulbs ) { int onBulbs = 0 ; int bulb = 1 ; int person = 1 ; for ( bulb = 1 ; bulb <= numberOfBulbs ; bulb ++ ) { int factors = 0 ; for ( person = 1 ; person * person <= numberOfBulbs ; person ++ ) { if ( bulb % person == 0 ) { factors ++ ; if ( bulb / person != person ) { factors ++ ; } } } if ( factors % 2 == 1 ) { System . out . println ( " Light ▁ bulb ▁ " + bulb + " ▁ will ▁ be ▁ on " ) ; onBulbs ++ ; } } return onBulbs ; }
(method_declaration (modifiers) type: (integral_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))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (update_expression (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) consequence: (block (expression_statement (update_expression (identifier))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal))))) (expression_statement (update_expression (identifier))))))) (return_statement (identifier))))