OFFSET
0,4
COMMENTS
A row of n black squares is to have a number of its squares replaced by rectangles of lengths 2 (red), 3 (green) or 4 (blue). In how many different ways can the original squares be replaced if rectangles cannot be mixed and at least one rectangle must be used?
LINKS
FORMULA
Empirical g.f.: -x^2*(3*x^7+2*x^6+x^4-3*x^3-x+1) / ((x-1)^2*(x^2+x-1)*(x^3+x-1)*(x^4+x-1)). - Colin Barker, Nov 14 2014
PROG
(Python)
import math
for n in range(1, 40):
ans = 0
for k in range(0, n):
for i in range(2, 5):
for j in range(1, ((k/i)+1)):
c = k - (i * j) + j
ans = ans + (math.factorial(c) / (math.factorial(j) * math.factorial(k-(i*j))))
print ans
CROSSREFS
KEYWORD
nonn
AUTHOR
Jameson Lee, Jul 02 2014
STATUS
approved