Korselt's criterion
Carmichael number - Wikipedia, the free encyclopedia
Korselt's criterion
Carmichael number - Wikipedia, the free encyclopedia
We know (6m+1)(12m+1)(18m+1) has exactly three prime factors, all of them distinct, based on what's given in the problem. So we test each prime in turn.
Show that 6m | (6m+1)(12m+1)(18m+1)-1
you can do so by expanding the right hand side and factoring out 6m from the result.
In fact you can combine all three steps considering that lcm(6m,12m,18m) = m*lcm(6,12,18) = 36m.