TUCSON — In a community college classroom here last June, on the first day of the term, the instructor in Jared L. Loughner’s basic algebra class, Ben McGahee, posed what he thought was a simple arithmetic question to his students. He was not prepared for the explosive response.

“How can you deny math instead of accepting it?” Mr. Loughner asked, after blurting out a random number, according to Mr. McGahee.

Mr. McGahee, for one, was disturbed enough by the experience to complain to school authorities, who as early as last June were apparently concerned enough themselves to have a campus officer visit the classroom. And what Mr. McGahee described as a pattern of behavior by Mr. Loughner, marked by hysterical laughter, bizarre non sequiturs and aggressive outbursts, only continued.

“I was getting concerned about the safety of the students and the school,” said Mr. McGahee, who took to glancing out of the corner of his eye when he was writing on the board for fear that Mr. Loughner might do something. “I was afraid he was going to pull out a weapon.”