How is the modulo number selected to build the hash table in DHP algorithm?
One possible reason to define the function this way is that it works for their example. It is an academic paper so it incentivized to find a novel solution that works on a specific dataset. In the paper, it is a synthetic dataset.

When building hash tables it is best practice to pick a prime (7 in this case) to minimize the number of collisions when using the modulo operator. The fact that is small prime is a clue that they building a toy system.