login
Period 2: repeat (3,4).
11

%I #74 Aug 03 2024 14:58:06

%S 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,

%T 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,

%U 3,4,3,4,3,4,3,4,3,4,3,4,3

%N Period 2: repeat (3,4).

%C Continued fraction expansion of A176102. - _R. J. Mathar_, Mar 08 2012

%C Also decimal expansion of 34/99. - _Nicolas Bělohoubek_, Nov 12 2021

%H Matthew House, <a href="/A010702/b010702.txt">Table of n, a(n) for n = 0..10000</a>

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

%F G.f.: (3+4*x)/(1-x^2). - _Jaume Oliver Lafont_, Mar 20 2009

%F a(n) = floor((n+1)*7/2) - floor((n)*7/2). - _Hailey R. Olafson_, Jul 23 2014

%F a(n) = 3 + (n mod 2) = 4 - ((n+1) mod 2). - _Wesley Ivan Hurt_, Jul 24 2014

%F From _Nicolas Bělohoubek_, Nov 12 2021: (Start)

%F a(n) = 12/a(n-1). See also A010696.

%F a(n) = 7 - a(n-1). See also A010695. (End)

%F a(n) = (7-(-1)^n)/2. - _Aaron J Grech_, Jul 28 2024

%p A010702:=n->3+(n mod 2): seq(A010702(n), n=0..100); # _Wesley Ivan Hurt_, Jul 24 2014

%t 3 + Mod[Range[0, 100], 2] (* _Wesley Ivan Hurt_, Jul 24 2014 *)

%t PadRight[{}, 100, {3, 4}] (* _Vincenzo Librandi_, Aug 01 2015 *)

%o (PARI) a(n)=3+n%2 \\ _Charles R Greathouse IV_, Dec 21 2011

%o (Haskell)

%o a010702 = (+ 3) . (`mod` 2)

%o a010702_list = cycle [3,4] -- _Reinhard Zumkeller_, Jul 05 2012

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

%o (Magma) &cat[[3,4]: n in [0..50]]; // _Vincenzo Librandi_, Aug 01 2015

%o (Python)

%o def A010702(n): return 3 + (n & 1) # _Chai Wah Wu_, May 25 2022

%Y Cf. A047355 (partial sums), A176102.

%Y Cf. A010695, A010696.

%K nonn,easy

%O 0,1

%A _N. J. A. Sloane_