A176040 Periodic sequence: Repeat 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, 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, 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
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,1).
Crossrefs
Programs
-
Magma
&cat[ [3, 1]: n in [0..52] ]; [ 2+(-1)^n: n in [0..104] ];
-
Mathematica
PadRight[{},120,{3,1}] (* or *) LinearRecurrence[{0,1},{3,1},120] (* Harvey P. Dale, Mar 11 2015 *)
Formula
a(n) = 2+(-1)^n.
a(n) = a(n-2) for n > 1; a(0) = 3, a(1) = 1.
a(n) = -a(n-1)+4 for n > 0; a(0) = 3.
a(n) = 3*((n+1) mod 2)+(n mod 2).
a(n) = A010684(n+1).
G.f.: (3+x)/((1-x)*(1+x)).
From Amiram Eldar, Jan 01 2023: (Start)
Multiplicative with a(2^e) = 3, and a(p^e) = 1 for p >= 3.
Dirichlet g.f.: zeta(s)*(1+2^(1-s)). (End)
Comments