%I #32 Mar 16 2023 11:25:35
%S 1,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,
%T 3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,
%U 2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2,2,3,2,2
%N Period 4 sequence [ 2, 2, 3, 2, ...] except a(0) = 1.
%C Continued fraction expansion of sqrt(33)/4. - _Bruno Berselli_, Feb 14 2011
%H Michael Somos, <a href="http://cis.csuohio.edu/~somos/rfmc.pdf">Rational Function Multiplicative Coefficients</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,1).
%F Euler transform of length 4 sequence [ 2, 0, -2, 1].
%F Moebius transform is length 4 sequence [ 2, 1, 0, -1].
%F a(n) = 2 * b(n) where b() is multiplicative with b(2) = 3/2, b(2^e) = 1 if e>1, b(p^e) = 1 if p>2.
%F G.f.: (1 + x + x^2)^2 / (1 - x^4). a(-n) = a(n). a(4*n + 2) = 3, a(2*n + 1) = 2, a(4*n) = 2 except a(0) = 1.
%F a(n) = 2+(1+(-1)^n)*(1-i^n)/4 - A000007(n), with i=sqrt(-1). - _Bruno Berselli_, Mar 16 2011
%e 1 + 2*x + 3*x^2 + 2*x^3 + 2*x^4 + 2*x^5 + 3*x^6 + 2*x^7 + 2*x^8 + 2*x^9 + ...
%t PadRight[{1},108,{2,2,3,2}] (* _Harvey P. Dale_, Oct 01 2011 *)
%o (PARI) {a(n) = 2 - (n==0) + (n%4 == 2)}
%o (PARI) {a(n) = polcoeff( (1 + x + x^2)^2 / (1 - x^4) + x * O(x^abs(n)), abs(n))}
%K nonn,easy
%O 0,2
%A _Michael Somos_, Feb 14 2011