login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

No pair of adjacent sectors can have the same color.

For n > 0: smallest prime factor of A098548(n).

LINKS

Stefano Spezia, Table of n, a(n) for n = 0..10000

FORMULA

G.f.: x*(1+2*x+2*x^2)/(1-x^2).

a(n) = (5/2)-[(-1)^n]/2-2*[C(2*n,n) mod 2]-2*{C[(n+1)^2,n+3] mod 2}, with n>=0. [Paolo P. Lava, Mar 31 2009]

E.g.f.: 2*cosh(x) + 3*sinh(x) - 2*(1 + x). - Stefano Spezia, Mar 24 2020

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

Cf. A010693, A158411.

Cf. A020639, A098548.

Sequence in context: A339092 A165587 A010693 * A139713 A171465 A178620

Adjacent sequences:  A158475 A158476 A158477 * A158479 A158480 A158481

KEYWORD

nonn

AUTHOR

Jaume Oliver Lafont, Mar 20 2009

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 31 04:45 EDT 2021. Contains 346367 sequences. (Running on oeis4.)