# Composite numbers and squares from recursive series

1. Mar 9, 2006

### ramsey2879

This has to do with the 2nd order recursive sequence $$\{...a, b, c ...\}$$ where a,b,c are any three sucessive terms and $$c = 6b-a + 2k$$.
I found that it has the following property.
$$8ab - (a+b-k)^2 = 8bc - (b+c-k)$$ That is eight times the product of two adjacent terms always equals the square of the difference between $$k$$ and the sum of the adjacent terms plus a number that is independent of three sucessive terms of the series are chosen.

A related property is the following. Again it is independent of which three sucessive terms of this sequence is chosen.

$$8a(a+k) - (b-3a-k)^2 = 8b(b+k) - (c-3b-k)^2$$

The proof of both is by induction
The proof of the first relation follows:

$$8ab - (a+b-k)^2 = 8bc - (b+c-k)^2$$
$$\quad = 8b(6b - a +2k) - (7b - a + k)^2$$
$$\quad = (48-49)b^2 -a^2 -k^2 +(-8 +14)ab +(16-14)bk +2a$$
$$\quad = 8ab -(b^2 +a^2 +k^2 +2ab -2bk -2ak)$$
$$\quad = 8ab -(b+a-k)^2$$

Thus the above property is proven.

Now if $$ab$$ is a triangular number for the first two terms of a
sequence, to make the product $$ab$$ to be a triangular number regardless of which pair of adjacent terms $$a \text{and} b$$ are in the sequence, we need to select a "k" such that $$8ab+1=(a+b-k)^2$$

I will leave the proof of the second part and how it relates to square triangular numbers up to the reader.

Last edited: Mar 9, 2006
2. Mar 19, 2006

### ramsey2879

Given the 2nd order recursive sequence $$\{...a, b, c ...\}$$ where a,b,c are any three sucessive terms and $$c = 6b-a + 2k$$.
The following equations for composits always hold

$$8ab - (a+b-k)^2 = 8bc - (b+c-k)^2$$
$$8a(a+k) - (b-3a-k)^2 = 8b(b+k) - (c-3b-k)^2$$

The proof of both is by induction
The proof of the first relation follows:

$$8ab - (a+b-k)^{2} = 8bc - (b+c-k)^{2}$$
$$\quad = 8b(6b - a +2k) - (7b - a + k)^2$$
$$\quad = (48-49)b^2 -a^2 -k^2 +(-8 +14)ab +(16-14)bk +2ak$$
$$\quad = 8ab -(b^2 +a^2 +k^2 +2ab -2bk -2ak)$$
$$\quad = 8ab -(b+a-k)^2$$

The proof of the second relation is

$$8a(a+k) -(b-3a-k)^{2} = 8b(b+k)-(c-3b-k)^{2}$$
$$\quad = 8b(b+k) - (3b-a+k)^2$$
$$\quad = (8-9)b^2 +(8-9)a^2 -k^2 +(8-6)bk +(8-6)ak +6ab$$
$$\quad = 8a(a+k) -b^2 -9a^2-k^2 +2bk -6ak +6ab$$
$$\quad = 8a(a+k) -(b -3a - k)^2$$

Now since the above relation holds for any three consecutive terms of the recursive sequence, if the product of any two terms $$ab$$ is a triangular number then there is a $$k$$ such that $$8ab+1=(a+b-k)^2$$ because it is known that 8 times a triangular number + 1 is always a square. But recursively from the above proven relationship, the product of any two adjacent terms of such a series where $$k$$ is so defined is always a triangular number.

In the second relation let $$k=0$$ then $$8a^2 = (b-3a)^2 +C$$ for any two adjacent terms of the recursive series. As an example the first two square triangular number are 0 and 1, since$$8*0 = (1-0)^2 -1$$, $$C=-1$$. Thus if b^2 is a triangular number, the next square triangular number $$c^2$$ is found by solving $$8b^2 =(c-3*b)^2 - 1$$.

Although square triangular numbers are well known, I haven't found a prior publication of this relationship. Surely someone before me must have noticed it. I would appreciate it if someone could lead me to a site that does discuss this.

Last edited: Mar 19, 2006
3. Mar 19, 2006

### shmoe

Square triangular numbers can be related to solutions of Pells equation $$x^2-2y^2=1$$. If $$b^2=n(n+1)/2$$ is your square triangular number, then x=(2n+1) and y=2b is a solution to Pells, and vice versa (non-negative solutions).

Your formula for getting the next square triangular number c^2 from a square triangular number b^2 follows from the usual way of generating the solutions to this equation, i.e. the solutions are given by powers of $$3+2\sqrt{2}$$, so to go to the next solution you just multiply by this. You get the same relation between c and b as you have.

Last edited: Mar 19, 2006
4. Mar 19, 2006

### ramsey2879

Thanks. I was aware of the relation to Pells equation but I dont see a easy way to get from the power of $$3+2\sqrt{2}$$ to my relation for $$a \text{ and }b$$. Also my relation is more general since $$k$$ need not equal 0 and the difference $$a_{n}*(a_{n} + k)- (a_{\left(n+1\right)} -3a_{n} -k)^2$$ need not equal -1 although it is a constant. For instance the sequence $$\{ \dots 0, 3, 22, 133, \dots\} \text{ where } k = 2$$ has the property that $$a_{n} * (a_{n} + k)$$ is always a triangular number since the constant is -1 as is the case with square triangular numbers.

I even have a greater generalization.

where $$k = -2$$ the following relation also holds:

for every pair of adjacent terms $$a \ \text{ and }\ b$$,
$$\ 8(a+n)(b+n) = (a+b + 2 - 4n)^2 + C \text{ where } C \text{is a constant dependent on n and}\ n$$ is any value including a complex value.

Last edited: Mar 19, 2006
5. Mar 19, 2006

### shmoe

It's a straightforward computation. If your square triangular number is b^2=n(n+1)/2, then $$n=(-1+\sqrt{1+8b^2})/2$$ so $$x=\sqrt{1+8b^2}$$ and $$y=2b$$. Multiply $$\sqrt{1+8b^2}+2b\sqrt{2}$$ by $$3+2\sqrt{2}$$ to get $$blah+(2\sqrt{1+8b^2}+6b)\sqrt{2}$$, so your next square triangle is at c^2 where $$c=\sqrt{1+8b^2}+3b$$

Last edited: Mar 19, 2006
6. Mar 20, 2006

### ramsey2879

Ok that works and is a little more straight forward than my formula, thanks.
Now to resolve my formula
$$8b^2+1 = (c-3b)^2 = c^2 -6cb +9b^2$$
$$1 = c^2 -6cb + b^2 \Rightarrow c*(6b-c) = b^2 - 1$$
I am lost as to where to go from here
But $$c = 6b -a \Rightarrow b^2-c*a = 1$$
$$c = \frac{b^2-1}{a}$$
Substituting c = 6b-a

$$1 = \frac{b^2-1}{6ba-a^2}$$

$$8(a + m)(b + m) = (a + b + 2 - 4m)^2 + C$$ where $$a$$ and $$b$$ are two adjacent terms in the recursive sequence defined by $$a_{n} = 6a_{\left(n-1\right)} - a_{\left(n-2\right)} - 4$$, $$C$$ is a constant dependent on m, and $$m$$ is any value?
$$7. Mar 24, 2006 ### ramsey2879 Relation to Pathagorean triples found. My friend wrote: "The values of [tex]c$$ in $$a^2 + b^2 = c^2$$ where $$|b - a| = 1$$ and gcd(a,b)=1 are generated from this recurrence relation:
$$c(1)=5$$, $$c(2)=29$$, $$c(n) = 6*c(n-1) - c(n-2)$$
( see http://www.research.att.com/~njas/sequences/A001653 )
What I find interesting is that apparently all Pythagorean triples can be generated with such recurrence relations. I am far from being a mathematician, and so I cannot prove any of this.
It is sufficient to look at primitive triples where gcd(a,b)=1.
The possible values of the difference |b - a| in primitive triples are 1,7,17,23,31,... see http://www.research.att.com/~njas/sequences/A058529 .
When |b-a| = 7, we have :
c(1)=13, c(2)=17, c(3)=73, c(4)=97, c(n) = 6*c(n-2) - c(n-4)
The values of a will be generated by:
a(1)=5, a(2)=8, a(3)=48, a(4)=65, a(n) = 6*a(n-2) - a(n-4) + 14

When |b-a| = 17, we have :
c(1)=25, c(2)=53, c(3)=137, c(4)=305, c(n) = 6*c(n-2) - c(n-4)
a(1)=7, a(2)=28, a(3)=88, a(4)=207, a(n) = 6*a(n-2) - a(n-4) + 34
When |b-a| = 23, we have :
c(1)=37, c(2)=65, c(3)=205, c(4)=373, c(n) = 6*c(n-2) - c(n-4)
a(1)=12, a(2)=33, a(3)=133, a(4)=252, a(n) = 6*a(n-2) - a(n-4) + 46
and so on...
Does anyone know of an explanation please?
Regards
Andras Erszegi".

It follows from the relation $$8(a(n))^2 - (a(n+1)-3*a(n))^2 = C$$ where $$C$$ is a constant for recursive series of the form $$a(n) = 6a(n-1)-a(n-2)$$ that I found. If you note that if any two adjacent terms of the Pell-like series {a,b,2b+a,5b+2a, … 2*a(n-1) + a(n-2) } are selected as y and x of the Pathagorean triples: x^2 + y^2, x^2-y^2, and 2xy then the value for $$(x^{2} - y^{2} - 2xy)^{2}$$ is a constant. Moreover, You will find that $$8{(a^{2} + b^{2})}^{2}-{({(2b+a)}^{2} + b^{2} \text{ minus }3(a^2+b^2))}^{2} = 4{(b^{2} - a^{2} \text{ minus } 2ab)}^{2}$$, i.e. the constant. Thus the series of c's for a constant absolute value of |$$x^2-y^2\text{ minus }2xy$$| is in the form of $$a(n) = 6a(n-1)-a(n-2)$$ .
Note that you some times have more than one such series for a constant value of $${(a^{2}-b^{2}\text{ minus }2ab)}^{2}$$ .

Last edited: Mar 25, 2006