For every group of 6 people put on a lock that none of them have the key to. Then give the remaining 7 people each a key to the lock. This ensures no minority can open it and ensures that any group larger than 6 can open the chest. In total there are 13 choose 7 locks. And 7 * (13 choose 6) keys. The keys are distributed equally so each pirate (7 * (13 choose 6))/13 keys