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-4 of 4 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

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

Original entry on oeis.org

1, 1, 1, 3, 5, 9, 5, 3, 1, 1, 1, 3, 5, 9, 5, 3, 1, 1, 1, 3, 5, 9, 5, 3, 1, 1, 1, 3, 5, 9, 5, 3, 1, 1, 1, 3, 5, 9, 5, 3, 1, 1, 1, 3, 5, 9, 5, 3, 1, 1, 1, 3, 5, 9, 5, 3, 1, 1, 1, 3, 5, 9, 5, 3, 1, 1, 1, 3, 5, 9, 5, 3, 1, 1, 1, 3, 5, 9, 5, 3, 1, 1, 1, 3, 5, 9, 5, 3, 1, 1, 1, 3, 5, 9, 5, 3, 1, 1, 1, 3, 5, 9, 5, 3, 1
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) + a(n-2) + 1)/a(n-3) (for n>3) has period 8. - James Propp, Nov 20 2002. This is the 8-cycle discovered by H. Todd - see Lyness, Note 1847. - 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
    nxt[{a_,b_,c_}]:={b,c,(b+c+1)/a}; Transpose[NestList[nxt,{1,1,1},110]][[1]] (* or *) PadRight[{},110,{1,1,1,3,5,9,5,3}] (* Harvey P. Dale, Jan 13 2015 *)
    LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 1},{1, 1, 1, 3, 5, 9, 5, 3},105] (* Ray Chandler, Aug 25 2015 *)

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 *)

A076369 a(n) = n + mu(n), where mu is the Moebius function (A008683).

Original entry on oeis.org

2, 1, 2, 4, 4, 7, 6, 8, 9, 11, 10, 12, 12, 15, 16, 16, 16, 18, 18, 20, 22, 23, 22, 24, 25, 27, 27, 28, 28, 29, 30, 32, 34, 35, 36, 36, 36, 39, 40, 40, 40, 41, 42, 44, 45, 47, 46, 48, 49, 50, 52, 52, 52, 54, 56, 56, 58, 59, 58, 60, 60, 63, 63, 64, 66, 65, 66, 68, 70, 69, 70, 72
Offset: 1

Views

Author

Reinhard Zumkeller and Labos Elemer, Oct 14 2002

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := n + MoebiusMu[n]; Array[a, 100] (* Amiram Eldar, Apr 09 2025 *)
  • PARI
    a(n) = n + moebius(n); \\ Amiram Eldar, Apr 09 2025

Formula

a(n) = n + mu(m) = A000027(n) + A008683(n).
a(n) = n iff n is not squarefree: a(A013929(k)) = A013929(k) and a(A005117(k)) <> A005117(k).
Showing 1-4 of 4 results.