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.

This page as a plain text file.
%I A130793 #76 Jul 29 2025 00:23:29
%S A130793 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,
%T A130793 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,
%U A130793 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
%N A130793 Periodic sequence with period 3: 1, 3, 5.
%C A130793 Continued fraction expansion of (9+sqrt(145))/16. - _Klaus Brockhaus_, Apr 28 2010
%C A130793 Decimal expansion of 5/37. - _Pontus von Brömssen_, Dec 11 2024
%D A130793 James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 277.
%H A130793 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,1).
%F A130793 From _R. J. Mathar_, Jun 13 2008: (Start)
%F A130793 a(n) = 3+2*A049347(n+1).
%F A130793 O.g.f.: (1+3x+5x^2)/((1-x)(1+x+x^2)). (End)
%F A130793 a(n) = ((n+1)^6 - n^6) mod 6. - _Gary Detlefs_, Mar 25 2012
%F A130793 a(n) = (2n+1) mod 6. - _Wesley Ivan Hurt_, Mar 30 2014
%F A130793 a(n) = 2*(n mod 3) + 1. - _Bruno Berselli_, Jul 25 2018
%F A130793 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
%F A130793 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
%p A130793 A130793:=n->((2*n+1) mod 6); seq(A130793(n), n=0..100); # _Wesley Ivan Hurt_, Mar 30 2014
%t A130793 Table[Mod[2 n + 1, 6], {n, 0, 100}] (* _Wesley Ivan Hurt_, Mar 30 2014 *)
%t A130793 PadRight[{}, 105, {1, 3, 5}] (* After Harvey P. Dale *)
%t A130793 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 *)
%o A130793 (PARI) a(n)=[1,3,5][n%3+1] \\ _Charles R Greathouse IV_, Jun 02 2011
%o A130793 (Magma) &cat [[1, 3, 5]^^35]; // _Vincenzo Librandi_, Jul 25 2018
%o A130793 (Python)
%o A130793 def A130793(n): return (n%3<<1)+1 # _Chai Wah Wu_, Apr 02 2025
%Y A130793 Cf. A021078, A049347.
%Y A130793 Cf. A176907 (decimal expansion of (9+sqrt(145))/16). - _Klaus Brockhaus_, Apr 28 2010
%K A130793 nonn,easy
%O A130793 0,2
%A A130793 _Paul Curtz_, Jul 15 2007