%I #16 Jan 01 2023 02:28:54
%S 3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,
%T 3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,
%U 3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3
%N Periodic sequence: Repeat 3, 1.
%C Interleaving of A010701 and A000012.
%C Also continued fraction expansion of (3+sqrt(21))/2.
%C Also decimal expansion of 31/99.
%C Essentially first differences of A014601.
%C Inverse binomial transform of 3 followed by A020707.
%C Second inverse binomial transform of A052919 without initial term 2.
%C Third inverse binomial transform of A007582 without initial term 1.
%C Exp( Sum_{n >= 1} a(n)*x^n/n ) = 1 + x + 2*x^2 + 2*x^3 + 3*x^4 + 3*x^5 + ... is the o.g.f. for A008619. - _Peter Bala_, Mar 13 2015
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0,1).
%F a(n) = 2+(-1)^n.
%F a(n) = a(n-2) for n > 1; a(0) = 3, a(1) = 1.
%F a(n) = -a(n-1)+4 for n > 0; a(0) = 3.
%F a(n) = 3*((n+1) mod 2)+(n mod 2).
%F a(n) = A010684(n+1).
%F G.f.: (3+x)/((1-x)*(1+x)).
%F From _Amiram Eldar_, Jan 01 2023: (Start)
%F Multiplicative with a(2^e) = 3, and a(p^e) = 1 for p >= 3.
%F Dirichlet g.f.: zeta(s)*(1+2^(1-s)). (End)
%t PadRight[{},120,{3,1}] (* or *) LinearRecurrence[{0,1},{3,1},120] (* _Harvey P. Dale_, Mar 11 2015 *)
%o (Magma) &cat[ [3, 1]: n in [0..52] ];
%o [ 2+(-1)^n: n in [0..104] ];
%Y Cf. A010701 (all 3's sequence), A000012 (all 1's sequence), A090458 (decimal expansion of (3+sqrt(21))/2), A010684 (repeat 1, 3), A014601 (congruent to 0 or 3 mod 4), A020707 (2^(n+2)), A052919, A007582 (2^(n-1)*(1+2^n)), A008619.
%K cofr,cons,easy,nonn,mult
%O 0,1
%A _Klaus Brockhaus_, Apr 07 2010