Yesterday I found the following:

**x**

^{2}+ 2y^{2}= 3^{n+2}must have integer non-zero solutions for x and y, for n = 0 and any positive integer n.

The iterator here is:

**u**

^{2}+ 2v^{2}= Fthen it must also be true that

**(u-2v)**

^{2}+ 2(u+v)^{2}= 3FOne starting result for x and y, for n=0, is u = 1 and u = 2:

**1**

^{2}+ 2*2^{2}= 9For n = 1, iterator gives next solution is x = -3, y = 3:

**3**

^{2}+ 2*3^{2}= 27For n = 2, next is x = 3, y = 0. So that stops. Interesting.

Here's another option.

Starting for n=0, with x = 1, and y=-2:

**1**

^{2}+ 2*(-2)^{2}= 9For n = 1, iterator says next is x = 5, y = -1:

**5**

^{2}+ 2*(-1)^{2}= 27For n = 2, next is x = 7, y = 4:

**7**

^{2}+ 2*4^{2}= 81For n = 3, next is x = 1, y = 11:

**1**

^{2}+ 2*11^{2}= 243That's more interesting for a bit, but next iteration with positives will pull in factors of 3 again. Which can be avoided by using a negative value again.

I'll do that just to see, using -11 for y.

For n = 4, with that change iterator says next is x = 23, y = -10:

**23**

^{2}+ 2*(-10)^{2}= 729So you can just switch to a negative whenever to avoid having 3 as a factor of x or y.

Interesting but tedious.

So it can be a little tricky using the iterator.

James Harris