login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A158478
Number of colors needed to paint n sectors of a circle.
10
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, 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, 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
OFFSET
0,3
COMMENTS
No pair of adjacent sectors can have the same color.
For n > 0: smallest prime factor of A098548(n).
Decimal expansion of 61/4950. - Elmo R. Oliveira, May 05 2024
FORMULA
G.f.: x*(1+2*x+2*x^2)/(1-x^2).
E.g.f.: 2*cosh(x) + 3*sinh(x) - 2*(1 + x). - Stefano Spezia, Mar 24 2020
a(n) = a(n-2) for n > 3. - Elmo R. Oliveira, May 05 2024
a(n) = (n mod 2) + (2 mod (n+1)). - Aaron J Grech, Sep 02 2024
MATHEMATICA
Join[Range[0, 1], ConstantArray[{2, 3}, 20]] // Flatten (* Robert Price, Jun 15 2020 *)
PROG
(PARI) a(n)=if(n<4, n, 2+n%2)
(Haskell)
a158478 n = if n < 4 then n else 2 + mod n 2
a158478_list = [0..3] ++ cycle [2, 3]
-- Reinhard Zumkeller, Nov 30 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Jaume Oliver Lafont, Mar 20 2009
STATUS
approved