A158515 Number of colors needed to paint a wheel graph on n nodes.
0, 1, 2, 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, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4
Offset: 0
Links
- Antti Karttunen, Table of n, a(n) for n = 0..1001
- Eric Weisstein's World of Mathematics, Wheel Graph
- Wikipedia, Wheel graph
- Index entries for linear recurrences with constant coefficients, signature (0,1).
Programs
-
Mathematica
PadRight[{0, 1, 2}, 100, {4, 3}] (* Paolo Xausa, Apr 22 2024 *)
-
PARI
a(n)=if(n<4,n,4-n%2)
-
Scheme
(define (A158515 n) (if (< n 4) n (- 4 (modulo n 2)))) ;; Antti Karttunen, Sep 14 2017
Formula
G.f.: x*(1+2*x+2*x^2+2*x^3)/(1-x^2)
Comments