# Good Rectangles and Evil Numbers

This is meant to be a Puzzling Challenge:

# Good Rectangles and Evil Numbers - Integrated

## Good Rectangle

We define a good rectangle with base $$\ x \$$ as a rectangle in which $$\ \frac lw = x \$$ where $$\ l \$$ is the length of the rectangle and $$\ w \$$ is the width of the rectangle.

## Tiling

This is simply to clarify. There should be no problem if you ignore this section, but I would like the question to be robust.

We define a tiling of a group of shapes onto another shape as a way to place the group of shapes such that:

• The shapes do not overlap

• The group of shapes covers the entire target shape

• The target shape covers the entire group of shape

(The latter two combined is equivalent such that the union of all shapes in the group is congruent to the target shape)

## Good Numbers

We define a positive integer as a good number in base $$\ x \$$ if it is possible to tile that many good rectangles of base $$\ x \$$ (not necessarily of the same size) onto a square of any side length.

## Evil Numbers

We define an evil number as a positive integer that is not a good number in that base.

...

Your Task: Given a number as the base $$\ x \$$ and a number as the number of rectangles $$\ n \$$, assuming that $$\ n \$$ is not an evil number in base $$\ x \$$, graphically output a tiling with $$\ n \$$ good rectangles in base $$\ x \$$.

This is .

• Your question makes it really unclear what is and isn't allowed as output. Please consider posting this in the sandbox first next time. Jun 7 at 17:35
• @Makonede posted in the sandbox days ago Jun 8 at 0:11