OFFSET
0,2
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
LINKS
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
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
KEYWORD
nonn,easy,less,changed
AUTHOR
Paul Curtz, Jul 15 2007
STATUS
approved