Colour Building

w: 1 (w)

r: 2 (ww, r)

lg: 3 (www, wr, rw)

(p: 5)

y: 8 (wwwww, wwwr, wwrw, wrww, wrr, rwww, rwr, rrw)

dg: 13 (wwwwww, wwwwr, wwwrw, wwrww, wwrr, wrwww, wrwr, wrrw, rwwww, rwwr, rwrw, rrww, rrr)

b: 21

Fibonacci sequence: To make a rod of length x, we can add a white rod to all the different rods of length x-1 or we can add a red rod to all the rods of length x-2. Let w(x) = number of ways of making rod length x, then we have w(x) = w(x-1) + w(x-2).

For white, red and light green rods, we have w(1) = 1, w(2) = 2, w(3) = 4 and for x > 3, w(x) = w(x-1) + w(x-2) + w(x-3).

In general, using rods of length n, m, ..., p, once we've established answers up to w(p), we have for x > p, w(x) = w(x-n) + w(x-m) + ... + w(x-p).