Find the wrong term in the series 3, 7, 15, 27, 63, 127.
27 is wrong; it should be 31. Each term is double the previous plus 1: 3, 7, 15, 31, 63, 127. Equivalently each term is 2^n - 1.
Explain it simply
In a wrong-term question, most of the series follows the rule and one term breaks it. Find the rule using the terms that look reliable, often the first two and the last two. Here 63 to 127 and 3 to 7 both fit "double and add 1", which tells you the rule; then test each term against it.
Example
Question: 3, 7, 15, 27, 63, 127. Which term is wrong?
- Try "x 2 + 1": 3 to 7, 7 to 15, 15 to 31 (not 27), 31 to 63, 63 to 127.
- Only 27 breaks the rule, and replacing it with 31 makes the rest fit.
- Wrong term = 27 (correct value 31).
Another view: the terms are 2^2 - 1, 2^3 - 1, 2^4 - 1, 2^5 - 1, 2^6 - 1, 2^7 - 1.
const s = [3];
for (let i = 0; i < 5; i++) s.push(s[s.length - 1] * 2 + 1);
console.log(s); // Output: [3,7,15,31,63,127]Check your rule against both neighbours of the suspect term. If 27 were right, 27 x 2 + 1 = 55 should follow, but 63 does.
What to say in the interview
"The rule is double and add one, which I confirm from the terms at both ends. 15 should be followed by 31, and 31 leads to 63, so 27 is the wrong term."
Common mistakes
- Choosing 63 as wrong because 27 to 63 does not fit; the fault lies with the term that breaks the rule on both sides.
- Settling on a rule after checking only the first two terms.