# A Tricky Diophantine Equation

Find the last three digits of the sum of all positive integers $$n \leq 2014$$ for which there exist integers $$a, b, c, d, e$$ (not necessarily distinct) such that $a^2+b^2+c^2+d^2+e^2= \left( 3^n + 1 \right) ^2 \left( 2 \cdot 3^{2n} + 5 \right) .$

×