Working with Pythagorean triples, I found that Pell numbers (1,2,5,12,29,70...) provide needed $m,n$ input values for Euclid's formula $\quad(A=m^2-n^2\quad B=2mn\quad C=m^2+n^2)\quad$ when seeking $\quad (B-A=\pm1).\quad$ For example $F(2,1)=(3,4,5)\quad F(5,2)=(21,20,29)\quad F(12,5)=(119,120,169)...\quad. $

I found a formula to generate them in The Online Encyclopedia of Integer Sequences. I also found that I could generate these needed pairs sequentially with a formula found by solving $(B-A)$ for $x$. I generalized the formula and now it generates both positive and negative Pell numbers in sequential order of increasing value. Any input value $n$ that does not yield an integer is not a Pell number. Any input Pell number yields the next (or prior) Pell number depending on the input sign.

$$p=\pm\bigg(n+\sqrt{2n^2+(-1)^{n}}\bigg)\quad\text{where $\pm$ is the sign of the input Pell number. Note:}\frac{n}{|n|}\text{ does not work for }\frac{0}{|0|}$$ For example $$p_{-12}=-\bigg(-12+\sqrt{288^2+(-1)^{-12}}\bigg)=(-1)(-12+17)=-5$$ $$p_{-5}=-\bigg(-5+\sqrt{50+(-1)^{-5}}\bigg)=(-1)(-5+7)=-2$$ $$p_{-2}=-\bigg(-2+\sqrt{8+(-1)^{-2}}\bigg)=(-1)(-2+3)=-1$$ $$p_{-1}=-\bigg(-1+\sqrt{2+(-1)^{-1}}\bigg)=(-1)(-1+1)=0$$ $$p_{0}=\bigg(0+\sqrt{0+(-1)^{0}}\bigg)=(0+1)=1$$ $$p_{1}=\bigg(1+\sqrt{2+(-1)^{1}}\bigg)=(1+1)=2$$ $$p_{2}=\bigg(2+\sqrt{8+(-1)^{2}}\bigg)=(2+3)=5$$ $$p_{5}=\bigg(5+\sqrt{50+(-1)^{5}}\bigg)=(5+7)=12$$

Has anyone seen this formula before? Is it useful or anything else I can't think to ask?

  • 1
    $\begingroup$ If we fix the difference $B-A$, we can determine the solutions by solving a corresponding pell-like equation. Shall I try to work this out in an answer ? $\endgroup$
    – Peter
    May 30, 2020 at 11:27
  • 1
    $\begingroup$ This would also mean that $2n^2+(-1)^n$ is a perfect square when $n$ is a Pell number, which is pretty interesting IMO. Great question! $\endgroup$ May 30, 2020 at 11:30
  • $\begingroup$ I have $3$ answer(s) to (B-A). My question is about the originality of my formula. $\endgroup$
    – poetasis
    May 30, 2020 at 11:37
  • $\begingroup$ I found this, where they talk about the equation I commented above and how it's related to the numerator and denominator of the closest rational approximation of $\sqrt{2}$ (which is exactly what the Pell numbers are) books.google.fi/… $\endgroup$ May 30, 2020 at 11:56
  • $\begingroup$ @Peter I have generalized this formula even more to find solutions for any $B-A=x$. FYI, for primitives, x is limited to prime numbers $(p)$ where $p=\pm1\mod8$ raised to any non-negative power. Under $100, x \in \{1,7, 17, 23, 31, 41, 47, 49, 71, 73, 79, 89, 97\}$ $\endgroup$
    – poetasis
    May 30, 2020 at 12:29

1 Answer 1


Starting with the recurrence relation $p_ {n + 1} = 2 p_ {n} + p_ {n - 1} $ (where $p_n$ is the $n$'th Pell number) immediately gives $$p_ {n + 1} - p_ {n} = p_ {n} + p_ {n - 1} $$ and $$ (p_ {n + 1} - p_ {n})^2 - p_n^2 = (p_n + p_ {n - 1})^2 - p_n^2 = (p_ {n + 1}) (p_ {n - 1}) \tag{1}$$

using the identity $(p_{n+1})(p_{n-1})=p_{n}^2+(-1)^n$ derived in A. F. Horadam, “Pell identities”, The Fibonacci Quarterly, 9 (3), (1971); https://www.fq.math.ca/9-3.html (Eq. 30)

we can obtain from (1) $$ (p_ {n + 1} - p_ {n})^2 - p_n^2=p_{n}^2+(-1)^n$$ which on rearranging becomes your formula

$$p_{n + 1}= p_ {n}+\sqrt{2p_{n}^2+(-1)^n}\tag{2}$$

https://mathworld.wolfram.com/PellNumber.html almost gives the equivalent identity on taking the square root of both sides of (11)

$$\frac{Q_n}{2}=p_{n + 1}-p_ {n}=\sqrt{2p_{n}^2+(-1)^n}$$

where $Q_n$ are the Pell-Lucas numbers

  • $\begingroup$ Thanks, you've shown me that my discovery is not unique. $\endgroup$
    – poetasis
    May 30, 2020 at 17:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.