login
A130793
Periodic sequence with period 3: 1, 3, 5.
4
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,2
COMMENTS
Continued fraction expansion of (9+sqrt(145))/16. - Klaus Brockhaus, Apr 28 2010
FORMULA
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
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
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 *)
PROG
(PARI) a(n)=[1, 3, 5][n%3+1] \\ Charles R Greathouse IV, Jun 02 2011
(Magma) &cat [[1, 3, 5]^^35]; // Vincenzo Librandi, Jul 25 2018
CROSSREFS
Cf. A021078.
Cf. A176907 (decimal expansion of (9+sqrt(145))/16). - Klaus Brockhaus, Apr 28 2010
Sequence in context: A049246 A231186 A021078 * A243854 A084243 A275056
KEYWORD
nonn,easy,less
AUTHOR
Paul Curtz, Jul 15 2007
STATUS
approved