This paper addresses the problem of costly sanctions, such as resource investment to induce cooperation or punishment for non-cooperation, in a large-scale language model (LLM) system with multiple agents. Using the public goods game in behavioral economics, we observe how various LLMs navigate social dilemmas in repeated interactions. Our analysis shows that LLMs exhibit four behavioral patterns: a type that maintains the level of cooperation continuously, a type that alternates between cooperation and non-cooperation, a type whose cooperative behavior decreases over time, and a type that follows a fixed strategy regardless of the outcome. Surprisingly, while LLMs with high reasoning ability, such as the o1 series, struggle to cooperate, some existing LLMs consistently achieve high levels of cooperation. This suggests that existing LLM improvement approaches that focus on improving reasoning ability do not necessarily lead to cooperation, and provides valuable insights for deploying LLM agents in environments that require continuous cooperation.