# The Smurfs

### How many ways of smurfing ?

A smurf A could smurf a smurf B without B smurfes A

A smurf could sometimes smurf himself

A smurf could smurf several smurfs, or be smurfed by several smurfs.

With only one smurf, there are two ways of smurfing :

- the smurf doesn't smurf

- the smurf smurfes himself

With two smurfs, there is even 16 ways of smurfing, for instance :

- no smurf smurf

- A smurfes himself

- A smurfes himself and B smurfes himself

- A surfes himself and A smurfes B

- A smurfes B and B smurfes A

- A smurfes himself, B smurfes himself, A smurfes B and B smurfes A

- ...

With 3 smurfs, how many ways of smurfing ?
Solution

With 4 smurfs ?
Solution
With n smurfs ?
Solution
Details

### Restrictions

We know that a smurf can't smurf more than p smurfs, and a smurf can't be smurfed by more than q smurfs.

How many ways of smurfing remains ?

With two smurfs, p=1, q=1 ? p=1, q=2 ?

Solution
With 3 smurfs, p,q=1,2,3 ?

Solution
With n smurfs ?

Solution
Details