From New Scientist #861, 30th August 1973 [link]
Miss Prism, being duly sworn, was asked for her age but remained mulishly silent.
“Come, come, my good woman”, snapped the judge, “you must answer the court’s questions”.
Counsel intervened smoothly. “I understand, M’Lud, that she is certainly over 40 and under 50, if it pleases you, M’Lud”.
“It does not please me, Sir Ambrose; I am thinking of having her committed”.
This threat overcame some of Miss Prisms reticence and she hastily deposed as follows: “When I stop speaking, I shall have made exactly two true statements. My age is divisible by 2. It is a perfect square. It is not 42. It is a prime number. It is divisible by three”. At this point she stopped speaking.
“Perjury, I fancy”, sniffed the judge.
“With respect, M’Lud, I fancy she has answered the question, if Your Lordship will attend carefully to the various possibilities”.
How old is the lady?
[tantalizer310]
Like this:
Like Loading...
Miss Prism makes 6 statements.
For age 48, three of the last 5 statements are true, so the first statement is false (along with 2 of the others).
For the other ages, two of the last 5 statements are true (and 3 of them are false), so the value of the first statement is undefined.
Either way Miss Prism has made several false statements while under oath, so it seems the judge is correct.
I expect each of the statements is to be assessed as either true or false, and this can only be done for age 48, hence this is the required age.
This Python program examines the possibilities
Run: [ @replit ]
Solution: She is 48.