cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A076839 A simple example of the Lyness 5-cycle: a(1) = a(2) = 1; a(n) = (a(n-1)+1)/a(n-2) (for n>2).

Original entry on oeis.org

1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 2
Offset: 1

Views

Author

N. J. A. Sloane, Nov 21 2002

Keywords

Comments

Any sequence a(1),a(2),a(3),... defined by the recurrence a(n) = (a(n-1)+1)/a(n-2) (for n>2) has period 5. The theory of cluster algebras currently being developed by Fomin and Zelevinsky gives a context for these facts, but it doesn't really explain them in an elementary way. - James Propp, Nov 20 2002
Equivalently, for n>2, a(n) > 0 is such that a(n-1)^2+4*a(n-2)*a(n) is a minimal square, with a(1)=1, a(2)=1. - Ray Chandler, May 16 2024

References

  • J. H. Conway and R. L. Graham, On Periodic Sequences Defined by Recurrences, unpublished, date?
  • Martin Gardner, The Magic Numbers of Dr Matrix, Prometheus Books, 1985, pages 198 and 305.

Crossrefs

See A335688/A335689 for a very similar nonperiodic sequence.
This sequence and A135352 are bisections of each other.

Programs

  • Maple
    a := 1; b := 1; f := proc(n) option remember; global a,b; if n=1 then a elif n=2 then b else (f(n-1)+1)/f(n-2); fi; end;
  • Mathematica
    RecurrenceTable[{a[1]==a[2]==1,a[n]==(a[n-1]+1)/a[n-2]},a,{n,110}] (* or *) LinearRecurrence[{0,0,0,0,1},{1,1,2,3,2},110] (* Harvey P. Dale, Jan 17 2013 *)

Formula

Periodic with period 5.
a(1)=1, a(2)=1, a(3)=2, a(4)=3, a(5)=2, a(n)=a(n-5). - Harvey P. Dale, Jan 17 2013

Extensions

Thanks to Michael Somos for pointing out the Kocic et al. (1993) reference. Also I deleted some useless comments. - N. J. A. Sloane, Jul 19 2020