According to MathWorld, check out eqn. 22 on this page, Euler had a result which I found I could also reach with my own research:

**x**

^{2}+ 7y^{2}= 2^{n}^{}

The applicable Binary Quadratic Diophantine iterator here, or BQD Iterator for short is:

u

^{2}+ 7v

^{2}= F

means that

[(u-7v)/2]

^{2}+ 7[(u+v)/2]

^{2}= 2*F

Here are some iterations:

**1**

^{2}+ 7*(1)^{2}= 2^{3}Next iteration:

**(-3)**

^{2}+ 7 = 2^{4}And next is:

**(-5)**

^{2}+ 7(-1)^{2}= 2^{5}And another iteration gives:

**(1)**

^{2}+ 7(-3)^{2}= 2^{6}One more gives:

**(11)**

^{2}+ 7(-1)^{2}= 2^{7}Notice that 7 is bare, in all but one case:

1

^{2}+ 7 = 2

^{3}, (-3)

^{2}+ 7 = 2

^{4}, (-5)

^{2}+ 7 = 2

^{5}, (11)

^{2}+ 7 = 2

^{7}

And also according to MathWorld, Ramanujan has a result called Ramanujan's square equation:

**x**

^{2}+ 7 = 2^{n}Which they say only has solutions for n = 3, 4, 5, 7 and 15.

That is listed on the first page I referenced on MathWorld as eqn. 21, but also has its own page.

And I've shown the n = 3, 4, 5 and 7 cases, but am not interested in iterating 8 more times to get the last one.

I can generalize from both of these results.

For example, in general you always have at least one iteration of the Ramanujan type:

**x**

^{2}+ (2^{c}- 1) = 2^{2c-2}Where x = (1 - (2

^{c}- 1))/2

And you can generate endless Euler type equations:

**x**

^{2}+ (2^{c}- 1)y^{2}= 2^{n(c-2)+c}Where here n = 0 or higher. I like starting it at 0, versus starting at c, as then n gives you a count of iterations.

And easily find x and y with the adjusted BQD Iterator, with u = v = 1, or u = v = -1:

u

^{2}+ (2

^{c}- 1)v

^{2}= F

then it must also be true that

[(u - (2

^{c}- 1)v)/2]

^{2}+ (2

^{c}- 1)[(u + v)/2]

^{2}= 2

^{c-2}*F

It's fascinating to ponder how Ramanujan found his result and Euler found his as well.

I can generate their results easily with my research plus go further, but there's nothing like getting that connection to two of the great mathematical minds of human history. It was the greatest thing for me stumbling across this connection.

It's extremely validating.

It makes it SO REAL as I know I could go to either of them if they were still alive and show them what I have, and know they'd cheer the math. Sure would make my life simpler if they were still alive. Or if any of the greats were still alive.

James Harris