for i in range(1,100):a = i * (i + 1)sum += a print(sum)for j in range (2,sum):if sum % j == 0:print(sum,"是合数。")break else:print(sum,"是质数")break