# Computation Workshop Solution Checker

## Four Primes

There are four unknown prime numbers $$a,b,c,d$$. You are given the values of the products: $$ab$$ and $$bc$$ and $$cd$$. Your task is to determine the value of $$a+b+c+d$$. For example, if $$ab=14$$ and $$bc=6$$ and $$cd=33$$ then the only solution is $$a=7, b=2, c=3, d=11$$ and so the answer would be $$a+b+c+d=7+2+3+11=23$$.
Part A $$ab=$$ 1679, $$bc=$$ 437, $$cd=$$ 2147. What is $$a+b+c+d$$? $$ab=$$ 289626105619, $$bc=$$ 429039650437, $$cd=$$ 134197842017. $$ab=$$ 992423084853790711349023202688646454111894545320268574266229, $$bc=$$ 956980335278386655528466944976628334778794612703832733966183, $$cd=$$ 994073261376744007461654636423577330810572537485993899025411. What is the remainder when $$a+b+c+d$$ is divided by $$(10^9+7)$$?

## Almost Square Triangles

A perfect square is any integer in the form $$n^2$$ where $$n$$ is an integer. A triangle number is any integer in the form $$\frac{n(n+1)}{2}$$ where $$n$$ is an integer. An almost-square-triangle is any triangle number which is one less than a perfect square. For example: $$3$$ is an almost-square-triangle because $$3$$ is a triangle number and $$4$$ is a perfect square. Let $$S(x)$$ denote the sum of all almost-square-triangles less than $$x$$. Since $$3$$ and $$0$$ are the only almost-square-triangles less than $$10$$, we have $$S(10) = 3$$.
Part A What is $$S(1000)$$? What is the remainder when $$S(10^{12})$$ is divided by $$(10^9+7)$$? What is the remainder when $$S(10^{1000})$$ is divided by $$(10^9+7)$$?