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.

A130793 Periodic sequence with period 3: 1, 3, 5.

Original entry on oeis.org

1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5, 1
Offset: 0

Views

Author

Paul Curtz, Jul 15 2007

Keywords

Comments

Continued fraction expansion of (9+sqrt(145))/16. - Klaus Brockhaus, Apr 28 2010
Decimal expansion of 5/37. - Pontus von Brömssen, Dec 11 2024

References

  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 277.

Crossrefs

Cf. A176907 (decimal expansion of (9+sqrt(145))/16). - Klaus Brockhaus, Apr 28 2010

Programs

  • Magma
    &cat [[1, 3, 5]^^35]; // Vincenzo Librandi, Jul 25 2018
    
  • Maple
    A130793:=n->((2*n+1) mod 6); seq(A130793(n), n=0..100); # Wesley Ivan Hurt, Mar 30 2014
  • Mathematica
    Table[Mod[2 n + 1, 6], {n, 0, 100}] (* Wesley Ivan Hurt, Mar 30 2014 *)
    PadRight[{}, 105, {1, 3, 5}] (* After Harvey P. Dale *)
    Nest[Flatten[# /. {1 -> {1, 3}, 3 -> {5, 1}, 5 -> {3, 5}}] &, {1}, 7] (* or *) CoefficientList[Series[-(5 x^2 + 3 x + 1)/(x^3 - 1), {x, 0, 105}], x] (* or *) LinearRecurrence[{0, 0, 1}, {1, 3, 5}, 105] (* Robert G. Wilson v, Jul 25 2018 *)
  • PARI
    a(n)=[1,3,5][n%3+1] \\ Charles R Greathouse IV, Jun 02 2011
    
  • Python
    def A130793(n): return (n%3<<1)+1 # Chai Wah Wu, Apr 02 2025

Formula

From R. J. Mathar, Jun 13 2008: (Start)
a(n) = 3+2*A049347(n+1).
O.g.f.: (1+3x+5x^2)/((1-x)(1+x+x^2)). (End)
a(n) = ((n+1)^6 - n^6) mod 6. - Gary Detlefs, Mar 25 2012
a(n) = (2n+1) mod 6. - Wesley Ivan Hurt, Mar 30 2014
a(n) = 2*(n mod 3) + 1. - Bruno Berselli, Jul 25 2018
a(n) = (2*r^n*(r-1)-2*r^(2*n)*(r+2)+9)/3 where r=(-1+i*sqrt(3))/2. - Ammar Khatab, Nov 28 2020
E.g.f.: 3*exp(x) - 2*(3*cos(sqrt(3)*x/2) + sqrt(3)*sin(sqrt(3)*x/2))/3. - Stefano Spezia, Jul 28 2025