We call a composite positive integer nice if it is possible to arrange its factors that are larger than on a circle such that two neighboring numbers are not coprime. How many of the elements of the set are nice?
Solution
If , where are distinct primes, it is clear that we can not arrange and without and being neighbors, therefore is not nice.
If is not a product of two distinct primes, then , where and . A convenient way of arranging the factors of , larger than , on a circle is the following: we write the numbers in a succession of the form:
where:
* is a sequence of numbers that contains all the factors of , other than , that are multiples of , the last one in the sequence being ;
* is a sequence of numbers that contains all the factors of that are multiples of , but not of , the last number in the sequence being ;
* is a sequence of numbers that contains all the factors of that are multiples of , but are multiples of neither nor , the last number in the sequence being ;
... and so on.
The set contains composite numbers, of which being of the form , with distinct primes. This leaves nice numbers.