methods, consider a passenger's seat number on a coach to be , and their coach number to be , and the numbers and are then fed into the two arguments of the pairing function. Prime powers method Send the guest in room to room , then put the first coach's load in rooms , the second coach's load in rooms ; for coach number we use the rooms where is the th odd prime number. This solution leaves certain rooms empty (which may or may not be useful to the hotel); specifically, all numbers that are not prime powers, such as 15 or 847, will no longer be occupied. (So, strictly speaking, this shows that the number of arrivals is less than or equal to the number of vacancies created. It is easier to show, by an independent means, that the number of arrivals is also greater than or equal to the number of vacancies, and thus that they are equal, than to modify the algorithm to an exact fit.) (The algorithm works equally well if one interchanges and , but whichever choice is made, it must be applied uniformly throughout.) Prime factorization method Each person of a certain seat and coach can be put into room (presuming c=0 for the people already in the hotel, 1 for the first coach, etc.). Because every number has a unique prime factorization, it is easy to see all people will have a room, while no two people will end up in the same room. For example, the person in room 2592 () was sitting in on the 4th coach, on the 5th seat. Like the prime powers method, this solution leaves certain rooms empty. This method can also easily be expanded for infinite nights, infinite entrances, etc. ( ) Interleaving method For each passenger, compare the lengths of and as written in any positional numeral system, such as decimal. (Treat each hotel resident as being in coach #0.) If either number is shorter, add leading zeroes to it until both values have the same number of digits. Interleave the digits to produce a room number: its digits will be [first digit of coach number]-[first digit of seat number]-[second digit of coach number]-[second digit of seat number]-etc. The hotel (coach #0) guest in room number 1729 moves to room 01070209 (i.e., room 1,070,209). The passenger on seat 1234 of coach 789 goes to