A010702 Period 2: repeat (3,4).
3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3
Offset: 0
Links
- Matthew House, Table of n, a(n) for n = 0..10000
- Index entries for linear recurrences with constant coefficients, signature (0,1).
Programs
-
Haskell
a010702 = (+ 3) . (`mod` 2) a010702_list = cycle [3,4] -- Reinhard Zumkeller, Jul 05 2012
-
Magma
[3 + (n mod 2) : n in [0..100]]; // Wesley Ivan Hurt, Jul 24 2014
-
Magma
&cat[[3,4]: n in [0..50]]; // Vincenzo Librandi, Aug 01 2015
-
Maple
A010702:=n->3+(n mod 2): seq(A010702(n), n=0..100); # Wesley Ivan Hurt, Jul 24 2014
-
Mathematica
3 + Mod[Range[0, 100], 2] (* Wesley Ivan Hurt, Jul 24 2014 *) PadRight[{}, 100, {3, 4}] (* Vincenzo Librandi, Aug 01 2015 *)
-
PARI
a(n)=3+n%2 \\ Charles R Greathouse IV, Dec 21 2011
-
Python
def A010702(n): return 3 + (n & 1) # Chai Wah Wu, May 25 2022
Formula
G.f.: (3+4*x)/(1-x^2). - Jaume Oliver Lafont, Mar 20 2009
a(n) = floor((n+1)*7/2) - floor((n)*7/2). - Hailey R. Olafson, Jul 23 2014
a(n) = 3 + (n mod 2) = 4 - ((n+1) mod 2). - Wesley Ivan Hurt, Jul 24 2014
From Nicolas Bělohoubek, Nov 12 2021: (Start)
a(n) = 12/a(n-1). See also A010696.
a(n) = 7 - a(n-1). See also A010695. (End)
a(n) = (7-(-1)^n)/2. - Aaron J Grech, Jul 28 2024
Comments