# Pentagonal Numbers

I recently was passing some time on Project Euler, when I came across this question. It deals with finding Pentagonal Numbers $P_j$ and $P_k$ such that $P_j+P_k$ and $P_j-P_k$ are also pentagonal numbers and $P_j-P_k$ is minimized. Without loss of generality, I am simply going to say that $j>k$ for the sake of solving the problem.

If you are not familiar with Project Euler, the idea of the site is to provide mathematical problems that can be solved with simple programs. It provides very good exercises in computer science and algorithms.

I noticed that some problems on the site can easily be solved with pen and paper (no "brute force" calculations needed). I feel as though this problem (though perhaps not as easily as some) can be solved by hand, although I keep hitting dead ends.

I have started with what I know: There are multiple (perhaps even infinitely many) solutions $j,k,n_1,n_2$ to the following:

\begin{align} P_j + P_k &= P_{n_1}\\ P_j - P_k &= P_{n_2} \end{align}

I want to relate these variables in a way such that I can find a class of solutions to this problem. Then, from there it should be easy to find the solution such that $P_j-P_k$ is minimized.

Using the relations described above and using the formula for a pentagonal number, I arrive at the following:

\begin{align} 3j^2 - j + 3k^2 - k &= 3n_1^2 - n_1\\ 3j^2 - j - 3k^2 + k &= 3n_2^2 - n_2 \end{align}

From here, I am unable to progress in any beneficial way. It seems that I hit a dead end no matter where I go from here. Any help is appreciated, thanks!

EDIT: I am looking for a solution. I simply do not have the proper background in number theory to elaborate on what these hints may be telling me to do. Nevertheless, I am really intrigued by how I could solve this.

Please provide or help me to come up with a specific way of solving this problem. Thanks!

• It curves triangular number. The General formula can be viewed there. math.stackexchange.com/questions/794510/… Formula can be written using the equations Pell. You can record and without this equation. – individ Aug 26 '15 at 15:51
• What are the solutions you have found so far? – gonthalo Aug 30 '15 at 12:09
• The problems in Project Euler are not intended for you to ask for solutions. – Mariano Suárez-Álvarez Aug 31 '15 at 8:59
• I already have a solution written in code, as intended. I am seeking a purely mathematical solution, which is clearly a different goal. – user134593 Sep 1 '15 at 0:32
• A vote up for your question – user243301 Sep 4 '15 at 18:48

Hint: If you want to focus on finding the minimal difference pentagonal number, let $Q_j = P_j - P_k$ and $Q_k = P_k$. Then you want to find minimal $j$ for two pentagonal numbers $Q_j$ and $Q_k$ so that $Q_j + Q_k = P_j$ is pentagonal and also $Q_j + 2Q_k = P_j + P_k$ is pentagonal. The choice of $Q_k = P_k$ is irrelevant, you just need $Q_j,Q_j+Q_k,Q_j + 2 Q_k$ are all pentagonal for given smallest possible pentagonal $Q_j$. For a given choice of $Q_j$ you should be able to lower and upper bound the possibilities for $Q_k$ (using the formula for pentagonal numbers, and the fact that you want $3$ pentagonal numbers in an arithmetic progression) which in turn will give you bounds on $k$ to check. You may even be able to narrow it down to one value of $k$ to check, which would make your program very fast as long as the minimal $j$ for this problem is not too big.

So it is easier to solve the system of equations is presented in this form.

\left\{\begin{aligned}&3x^2-xq+3y^2-yq=3z^2-zq\\&3x^2-xq-3y^2+yq=3f^2-fq\end{aligned}\right.

Then the solution can be written as.

$$x=-15b^2-4ab+35a^2+2(17b-33a)c+16c^2$$

$$y=50(b-a)(2c-a-b)$$

$$q=6(-25b^2-4ab+25a^2+2(27b-23a)c-4c^2)$$

$$z=-15b^2-24ab+15a^2+2(27b-3a)c-24c^2$$

$$f=-35b^2-24ab+35a^2+2(47b-23a)c-24c^2$$

$a,b,c -$ Any integers.

Then just. Solve the equation. $q=6$

Solve and then substitute to find out whether there is such $a,b,c$ That at the same time $x,y,z,f$ it is divisible by 6.

Although I think that no such numbers.

The solution can be written in this form.

$$x=b^2+4ab+3a^2+2(b+a)c$$

$$y=8(ab+(b-a)c-c^2)$$

$$q=6(-b^2+4ab+a^2+2(3b-a)c-4c^2)$$

$$z=b^2+8ab-a^2+2(3b-5a)c-8c^2$$

$$f=-3b^2+8ab+3a^2+2(7b-a)c-8c^2$$