# [seqfan] Re: possible relation in A005132 Recaman's sequence

Maximilian Hasler maximilian.hasler at gmail.com
Wed Jun 3 14:48:26 CEST 2009

```Of course, since by definition
(a(n)-a(n-1))^2=n^2 and thus
(a(n+1)-a(n))^2=(n+1)^2, (a(n-1)-a(n-2))^2=(n-1)^2
so (using a^2-b^2=(a+b)(a-b))
(x-y)^2-2(y-z)^2+(z-t)^2 = (2n+1)(1) - (2n-1)(-1) = 2

But the interesting information consists in the sign of  a(n)-a(n-1),
which is lost by squaring.

Maximilian

On Wed, Jun 3, 2009 at 4:05 AM, Georgi Guninski <guninski at guninski.com> wrote:
> http://www.research.att.com/~njas/sequences/?q=A005132&sort=0&fmt=0&language=english&go=Search
> A005132  Recaman's sequence: a(0) = 0; for n > 0, a(n) = a(n-1)-n if
> that number is positive and not already in the sequence, otherwise a(n)
> = a(n-1)+n
>
> seems to satisfy:
>
> a(n-2)^2 - 2*a(n-2)*a(n-1) - a(n-1)^2 + 4*a(n-1)*a(n) - a(n)^2
> - 2*a(n)*a(n+1) + a(n+1)^2 - 2 = 0
>
> ( x^2 - 2*x*y - y^2 + 4*y*z - z^2 - 2*z*t + t^2 - 2 = 0 )
>
> verified to 10^5 using the B file from OEIS.
>
>
>
> _______________________________________________
>
> Seqfan Mailing list - http://list.seqfan.eu/
>

```