login
Period 3: repeat [1, 3, 2].
9

%I #63 Dec 14 2023 05:21:13

%S 1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,

%T 3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,

%U 2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3

%N Period 3: repeat [1, 3, 2].

%C Continued fraction expansion of (3+sqrt(37))/7 (A176977). - _Klaus Brockhaus_, Apr 30 2010

%C Pairwise sums of A010872(n). - _Wesley Ivan Hurt_, Jul 08 2014

%C Decimal expansion of 44/333. - _David A. Corneth_, Jul 02 2016

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

%F a(n) = 4 - n + 3*floor((n-1)/3). - _Wesley Ivan Hurt_, Nov 30 2013

%F a(n) = A080425(n) + 1. - _Wesley Ivan Hurt_, Jul 08 2014

%F a(n) = 3 - ((n+5) mod 3) = 1 + (-n mod 3). - _Wesley Ivan Hurt_, Aug 29 2014

%F From _Robert Israel_, Aug 29 2014: (Start)

%F a(n) = 3*a(n-1)^2/2 - 13*a(n-1)/2 + 8.

%F O.g.f.: (1+z)*(1+2*z)/(1-z^3).

%F E.g.f.: 2*exp(z) - 2/sqrt(3)*exp(-z/2)*cos(sqrt(3)*z/2+Pi/6). (End)

%F a(n) = a(n-3) for n>2. - _Wesley Ivan Hurt_, Jul 02 2016

%p A130784:=n->4-n+3*floor((n-1)/3); seq(A130784(n), n=0..100); # _Wesley Ivan Hurt_, Nov 30 2013

%t PadRight[{}, 111, {1,3,2}] (* _Harvey P. Dale_, Apr 20 2012 *)

%t CoefficientList[Series[(1 + 3 x + 2 x^2)/(1 - x^3), {x, 0, 120}], x] (* _Michael De Vlieger_, Jul 02 2016 *)

%o (PARI) a(n)=[1,3,2][n%3+1] \\ _Charles R Greathouse IV_, Jun 02 2011

%o (Magma) [(n mod 3) + ((n+1) mod 3) : n in [0..100]]; // _Wesley Ivan Hurt_, Jul 08 2014

%Y Cf. A010872, A080425, A176977.

%K nonn,easy

%O 0,2

%A _Paul Curtz_, Jul 15 2007