# Arranging people in groups at a conference

54 people attend a conference.
There are 6 tables that each seat 9 people.
Each table has a different topic and all 54 people have to move around and sit at each table.
Can you advise a formula as to how to move everyone numbered from 1-54 to different tables in a way that each person meets as many other people as possible.

(Note: this is more a mathematical problem rather than a puzzle.)

As a first approximation, the algorithm can be seen as follows (it can be not optimal though):

Since after each rearrangement, each of the 9 people on a table must occupy a seat at one of the 5 remaining tables, the best way for them to allow meeting more new people is that the one of them goes to the next table (1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 1 etc.), and the other 8 people group in pairs for other 4 tables. E.g.
01 02 03 04 05 06 07 08 09
10 11 12 13 14 15 16 17 18
19 20 21 22 23 24 25 26 27
28 29 30 31 32 33 34 35 36
37 38 39 40 41 42 43 44 45
46 47 48 49 50 51 52 53 54
will rotate to
17 18 24 25 31 32 38 39 46
01 26 27 33 34 40 41 47 48
02 03 10 35 36 42 43 49 50
04 05 11 12 19 44 45 51 52
06 07 13 14 20 21 28 53 54
08 09 15 16 22 23 29 30 37
The same algorithm can be repeated for the next iteration, however one should watch to break the pairs moving from one table to another (i.e. 2 and 3 moved from table 1 to 3, and on the next iteration they should move to different unvisited tables, for example 4 and 5)