Problem 835
Supernatural Triangles
A Pythagorean triangle is called supernatural if two of its three sides are consecutive integers.
Let $S(N)$ be the sum of the perimeters of all distinct supernatural triangles with perimeters less than or equal to $N$.
For example, $S(100) = 258$ and $S(10000) = 172004$.
Find $S(10^{10^{10}})$. Give your answer modulo $1234567891$.
超自然三角形
若一个毕达哥拉斯三角形(译注:三边长均为正整数的直角三角形)的三边中有两边长是连续整数,则称其为超自然三角形。
考虑所有不同的、周长小于等于$N$的超自然三角形,记其周长之和为$S(N)$。
例如,$S(100) = 258$,$S(10000) = 172004$。
求$S(10^{10^{10}})$,并将你的答案对$1234567891$取余。