# Diophantine sequence

Dean Hickerson dean at math.ucdavis.edu
Thu Oct 17 23:35:28 CEST 2002

```Ed Pegg wrote:

> 2^n - 2 = 7(x^2 - x) + (y^2 - y)
>
> Euler proved that the above diophantine equation has a unique solution

Actually a unique *positive* solution; you can change x to 1-x and/or y to
1-y.

> for any n.

For any positive n.

> (Engel, Problem-Solving Strategies)  He never published his result or proof.
>
> This leads to an odd set of sequences:
> {1, 2, 3, 1, 6, 5, 7, 16, 3, 29, 34, 24, 91, 44, 138, 225, 51, 500, 399,
> 601, 1398}
> {1, 1, 1, 2, 1, 3, 4, 2, 9, 6, 12, 23, 1, 46, 45, 47, 136, 43, 229, 314,
> 144}

Note that the equation is equivalent to

2^(n+2) = (2y-1)^2 + 7 (2x-1)^2,

so it's related to norms of elements of the ring of integers in the quadratic
field Q(sqrt(-7)), and Euler's claim presumably follows from unique
factorization in that field.  (I haven't checked the details.)

From this we can get a formula for the x's and y's:  Let  a(n)  and  b(n)
be the unique rational numbers such that

a(n) + b(n) sqrt(-7) = ((1 + sqrt(-7))/2)^n.

I.e.

a(n) = (((1 + sqrt(-7))/2)^n + ((1 - sqrt(-7))/2)^n)/2

and

b(n) = (((1 + sqrt(-7))/2)^n - (((1 - sqrt(-7))/2)^n))/(2 sqrt(-7)).

Then  x(n) = abs(b(n)) + 1/2  and  y(n) = abs(a(n)) + 1/2:

n  1  2  3  4  5  6  7   8  9  10  11  12  13  14   15   16   17   18   19
y(n)  1  2  3  1  6  5  7  16  3  29  34  24  91  44  138  225   51  500  399
x(n)  1  1  1  2  1  3  4   2  9   6  12  23   1  46   45   47  136   43  229

Dean Hickerson
dean at math.ucdavis.edu

```