AdaRooks implementation using prime numbers

I read in this article that https://aleigorithms.wordpress.com/2019/05/06/codechef-may-challenge-2019/ Ada rooks2 can also be implemented using prime numbers can anyone tell me how?
question link