login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A130793 Periodic sequence with period 3: 1, 3, 5. 4

%I #54 Dec 14 2023 05:21:09

%S 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 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 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 Periodic sequence with period 3: 1, 3, 5.

%C Continued fraction expansion of (9+sqrt(145))/16. - _Klaus Brockhaus_, Apr 28 2010

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,1).

%F a(n) = 3+2*A049347(n+1). O.g.f.: (1+3x+5x^2)/((1-x)(1+x+x^2)). - _R. J. Mathar_, Jun 13 2008

%F a(n) = ((n+1)^6 - n^6) mod 6. - _Gary Detlefs_, Mar 25 2012

%F a(n) = (2n+1) mod 6. - _Wesley Ivan Hurt_, Mar 30 2014

%F a(n) = 2*(n mod 3) + 1. - _Bruno Berselli_, Jul 25 2018

%F 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

%p A130793:=n->((2*n+1) mod 6); seq(A130793(n), n=0..100); # _Wesley Ivan Hurt_, Mar 30 2014

%t Table[Mod[2 n + 1, 6], {n, 0, 100}] (* _Wesley Ivan Hurt_, Mar 30 2014 *)

%t PadRight[{}, 105, {1, 3, 5}] (* After Harvey P. Dale *)

%t 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 (PARI) a(n)=[1,3,5][n%3+1] \\ _Charles R Greathouse IV_, Jun 02 2011

%o (Magma) &cat [[1, 3, 5]^^35]; // _Vincenzo Librandi_, Jul 25 2018

%Y Cf. A021078.

%Y Cf. A176907 (decimal expansion of (9+sqrt(145))/16). - _Klaus Brockhaus_, Apr 28 2010

%K nonn,easy,less

%O 0,2

%A _Paul Curtz_, Jul 15 2007

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 19:21 EDT 2024. Contains 371754 sequences. (Running on oeis4.)