Joe is either a knight, a liar, or a knave. His favorite number is an integer between 1 and 1000. He makes the following statements about his favorite number:
1. It is odd.
2. It is divisible by 7.
3. It is divisible by 23.
4. It is not divisible by 19.
5. It has an even number of divisors.
6. It ends in 9.
What type is Joe, and what is his favorite number?

If Joe were a knight and all the statements were true, then the number would be divisible by 7*23=161, which ends in a 1. The lowest multiple of 161 that would end in a 9 would be 161*9=1449, which is higher than the limit provided, so Joe is not a knight.

If Joe were a liar, so that all the statements would be false, the number would have to be even and divisible by 19, and thus by 38. In order to have an odd number of divisors, it would have to be a perfect square, so the smallest could be 38^2=1444, which is also above the limit of 1000.

So Joe is a knave. Statement 1 can't be false while 6 is true, so it must be the other way around. The number is odd and divisible by 23 and 19, but not by 7. 19*23=437, which indeed is not a perfect square, and so has an even number of divisors. Any larger odd multiple of 437 would be too large for the 1000 limitation.