Table seating in python

You may have encountered a problem on Brilliant about seating people around a long table made out of n-sided tables of equal side lengths. This one goes a little bit further.

You are preparing a big feast. You need to create one long table from small regular shaped n-lateral tables. We illustrate this in the picture bellow. You may seat one and only one person at each side of the small table.

What is the sum of all posible side numbers (triangle = 3, square = 4 etc.) you can use to seat 112 people?

Although this can be done on paper, try to use python and let the computer do the job!

×

Problem Loading...

Note Loading...

Set Loading...