# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/
Search: id:a158478
Showing 1-1 of 1
%I A158478 #32 Sep 03 2024 15:10:40
%S A158478 0,1,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,
%T A158478 2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,
%U A158478 2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2
%N A158478 Number of colors needed to paint n sectors of a circle.
%C A158478 No pair of adjacent sectors can have the same color.
%C A158478 For n > 0: smallest prime factor of A098548(n).
%C A158478 Decimal expansion of 61/4950. - _Elmo R. Oliveira_, May 05 2024
%H A158478 Stefano Spezia, Table of n, a(n) for n = 0..10000
%H A158478 Index entries for linear recurrences with constant coefficients, signature (0,1).
%F A158478 G.f.: x*(1+2*x+2*x^2)/(1-x^2).
%F A158478 E.g.f.: 2*cosh(x) + 3*sinh(x) - 2*(1 + x). - _Stefano Spezia_, Mar 24 2020
%F A158478 a(n) = a(n-2) for n > 3. - _Elmo R. Oliveira_, May 05 2024
%F A158478 a(n) = (n mod 2) + (2 mod (n+1)). - _Aaron J Grech_, Sep 02 2024
%t A158478 Join[Range[0, 1], ConstantArray[{2, 3}, 20]] // Flatten (* _Robert Price_, Jun 15 2020 *)
%o A158478 (PARI) a(n)=if(n<4,n,2+n%2)
%o A158478 (Haskell)
%o A158478 a158478 n = if n < 4 then n else 2 + mod n 2
%o A158478 a158478_list = [0..3] ++ cycle [2,3]
%o A158478 -- _Reinhard Zumkeller_, Nov 30 2014
%Y A158478 Cf. A010693, A020639, A098548, A158411.
%K A158478 nonn
%O A158478 0,3
%A A158478 _Jaume Oliver Lafont_, Mar 20 2009
# Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE