Run 'join' with the number-sorted output of file1 and file2, without modifying file1 or file2: for each line with a common first field in file1 and file2, output the common field followed by the extra fields in both files.
join <(sort -n file1) <(sort -n file2)