Each of the four integers has 1 as a divisor. Moreover, 2 is a common divisor of either N and N+2 or N+1 and N+3. Hence, these four integers can have at most 6×4−3−1=20 different divisors altogether. Because there are exactly 20 different positive divisors, only one of the four integers can be divisible by 3, that is either N+1 or N+2 is divisible by 3.
As 27 is a divisor of one of the integers, and the integer has exactly six divisors, that number must be 35=243. This can be seen, for example, by recognising that an integer p1a1⋯pnan, with primes p1<⋯<pn and ai≥1, has exactly (a1+1)⋯(an+1) different positive divisors.
Hence N+1=243 or N+2=243. Because 243−2=241 is a prime number (having only two positive divisors), we can only have N=242.
It is easily checked that the four numbers 242=2⋅112, 243=35, 244=22⋅61 and 245=5⋅72 have exactly 20 divisors, namely 1, 2, 3, 4, 5, 7, 9, 11, 22, 27, 35, 49, 61, 81, 121, 122, 242, 243, 244 and 245.