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.

Showing 1-6 of 6 results.

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

A076840 a(1) = a(2) = 1; a(n) = (a(n-1) + 1)/a(n-2) (for n>2, n odd), (a(n-1)^2 + 1)/a(n-2) (for n>2, n even).

Original entry on oeis.org

1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 2, 5, 3, 2, 1, 1, 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, n odd), (a(n-1)^2+1)/a(n-2) (for n>2, n even) has period 6. 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

Crossrefs

Programs

  • Maple
    a := 1; b := 1; f := proc(n) option remember; global a,b; if n=1 then RETURN(a); fi; if n=2 then RETURN(b); fi; if n mod 2 = 1 then RETURN((f(n-1)+1)/f(n-2)); fi; RETURN((f(n-1)^2+1)/f(n-2)); end;
  • Mathematica
    LinearRecurrence[{0, 0, 0, 0, 0, 1}, {1, 1, 2, 5, 3, 2}, 105] (* Jean-François Alcover, Nov 22 2017 *)

A076841 a(1) = a(2) = 1; a(n) = (a(n-1)+1)/a(n-2) (for n>2, n odd), (a(n-1)^3+1)/a(n-2) (for n>2, n even).

Original entry on oeis.org

1, 1, 2, 9, 5, 14, 3, 2, 1, 1, 2, 9, 5, 14, 3, 2, 1, 1, 2, 9, 5, 14, 3, 2, 1, 1, 2, 9, 5, 14, 3, 2, 1, 1, 2, 9, 5, 14, 3, 2, 1, 1, 2, 9, 5, 14, 3, 2, 1, 1, 2, 9, 5, 14, 3, 2, 1, 1, 2, 9, 5, 14, 3, 2, 1, 1, 2, 9, 5, 14, 3, 2, 1, 1, 2, 9, 5, 14, 3, 2, 1, 1, 2, 9, 5, 14, 3, 2, 1, 1, 2, 9, 5, 14, 3, 2, 1, 1, 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, n odd), (a(n-1)^3+1)/a(n-2) (for n>2, n even) has period 8. 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

Crossrefs

Programs

  • Maple
    a := 1; b := 1; f := proc(n) option remember; global a,b; if n=1 then RETURN(a); fi; if n=2 then RETURN(b); fi; if n mod 2 = 1 then RETURN((f(n-1)+1)/f(n-2)); fi; RETURN((f(n-1)^3+1)/f(n-2)); end;
  • Mathematica
    LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 1},{1, 1, 2, 9, 5, 14, 3, 2},99] (* Ray Chandler, Aug 25 2015 *)

A076842 Numerators of sequence of fractions defined by a(1) = a(2) = 1; for n > 2, a(n) = (a(n-1)+a(n-2)+1)/a(n-2).

Original entry on oeis.org

1, 1, 3, 5, 3, 9, 29, 71, 751, 5095, 117707, 8786157, 1495204807, 869159527657, 10563805576326283, 3058448407404141530011, 21945047981309619478239602921, 78849616271246494204031567399858651677, 163732240861295155285004461265839986271194799721161
Offset: 1

Views

Author

N. J. A. Sloane, Nov 21 2002

Keywords

Examples

			1, 1, 3, 5, 3, 9/5, 29/15, 71/27, 751/261, 5095/2059, 117707/53321, ...
		

Crossrefs

Programs

  • Maple
    a := 1; b := 1; f := proc(n) option remember; global a,b; if n=1 then RETURN(a); fi; if n=2 then RETURN(b); fi; RETURN((f(n-1)+f(n-2)+1)/f(n-2)); end;

A076843 Denominators of sequence of fractions defined by a(1) = a(2) = 1; for n > 2, a(n) = (a(n-1)+a(n-2)+1)/a(n-2).

Original entry on oeis.org

1, 1, 1, 1, 1, 5, 15, 27, 261, 2059, 53321, 3826345, 599717165, 344730727333, 4379034727152233, 1299571503802595847199, 9181632264980134793594508931, 32308854341042109701936418652172579113, 67117797048843876734329361265492957492346044762131
Offset: 1

Views

Author

N. J. A. Sloane, Nov 21 2002

Keywords

Examples

			1, 1, 3, 5, 3, 9/5, 29/15, 71/27, 751/261, 5095/2059, 117707/53321, ...
		

Crossrefs

Programs

  • Maple
    a := 1; b := 1; f := proc(n) option remember; global a,b; if n=1 then RETURN(a); fi; if n=2 then RETURN(b); fi; RETURN((f(n-1)+f(n-2)+1)/f(n-2)); end;
  • Mathematica
    Denominator[RecurrenceTable[{a[1]==a[2]==1,a[n]==(a[n-1]+a[n-2]+1)/ a[n-2]},a,{n,20}]] (* Harvey P. Dale, Jul 20 2014 *)

A335690 a(1) = 1, a(2) = a(3) = 2; a(n) = (a(n-1) + a(n-2) + 1)/a(n-3) (for n>3).

Original entry on oeis.org

1, 2, 2, 5, 4, 5, 2, 2, 1, 2, 2, 5, 4, 5, 2, 2, 1, 2, 2, 5, 4, 5, 2, 2, 1, 2, 2, 5, 4, 5, 2, 2, 1, 2, 2, 5, 4, 5, 2, 2, 1, 2, 2, 5, 4, 5, 2, 2, 1, 2, 2, 5, 4, 5, 2, 2, 1, 2, 2, 5, 4, 5, 2, 2, 1, 2, 2, 5, 4, 5, 2, 2, 1, 2, 2, 5, 4, 5, 2, 2, 1, 2, 2, 5, 4
Offset: 1

Views

Author

N. J. A. Sloane, Jul 19 2020

Keywords

Comments

This is another illustration of the 8-cycle discovered by H. Todd - see Lyness, Note 1847. Compare A076844. - N. J. A. Sloane, Jul 19 2020

Crossrefs

Programs

  • Maple
    a := 1; b := 1; c := 1; f := proc(n) option remember; global a,b,c; if n=1 then RETURN(a); fi; if n=2 then RETURN(b); fi; if n=3 then RETURN(c); fi; RETURN((f(n-1)+f(n-2)+1)/f(n-3)); end;
  • Mathematica
    RecurrenceTable[{a[1]==1,a[2]==a[3]==2,a[n]==(a[n-1]+a[n-2]+1)/a[n-3]},a,{n,90}] (* or *) PadRight[{},90,{1,2,2,5,4,5,2,2}] (* Harvey P. Dale, May 28 2021 *)
Showing 1-6 of 6 results.