UPSC CSAT 2025 Q27: Primes p and k with p² + k Prime — Solved

Let both p and k be prime numbers such that (p² + k) is also a prime number less than 30. What is the number of possible values of k ?

  1. 4
  2. 5
  3. 6
  4. 7

Answer: (b) 5

Solution

  1. Write down what is given. p is prime, k is prime, and p² + k is a prime less than 30. We need the number of different values k can take.

  2. Use parity (odd or even). Every prime except 2 is odd. - If p and k are both odd, then p² is odd, and odd + odd = even. - So p² + k would be an even number of at least 3² + 3 = 12. An even number greater than 2 is not prime. - So p and k cannot both be odd. At least one of them must be 2.

  3. Case A: p = 2. Then p² + k = 4 + k. We need 4 + k to be prime and less than 30, so k < 26. - k = 2: 4 + 2 = 6, not prime. ✗ - k = 3: 4 + 3 = 7, prime. ✓ - k = 5: 4 + 5 = 9 = 3 × 3, not prime. ✗ - k = 7: 4 + 7 = 11, prime. ✓ - k = 11: 4 + 11 = 15 = 3 × 5, not prime. ✗ - k = 13: 4 + 13 = 17, prime. ✓ - k = 17: 4 + 17 = 21 = 3 × 7, not prime. ✗ - k = 19: 4 + 19 = 23, prime. ✓ - k = 23: 4 + 23 = 27 = 3 × 9, not prime. ✗ - The next prime, 29, gives 33, which is more than 30. Stop. - Values of k from this case: 3, 7, 13, 19.

  4. Case B: k = 2. Then p² + k = p² + 2. We need p² + 2 to be prime and less than 30, so p² < 28. That means p can only be 2, 3 or 5. - p = 2: 4 + 2 = 6, not prime. ✗ (This was already checked in Case A.) - p = 3: 9 + 2 = 11, prime. ✓ - p = 5: 25 + 2 = 27, not prime. ✗ - So k = 2 works, with p = 3.

  5. Combine the cases. The possible values of k are 2, 3, 7, 13 and 19. - The valid pairs (p, k) are (2, 3), (2, 7), (2, 13), (2, 19) and (3, 2). The primes they give are 7, 11, 17, 23 and 11. All are prime and less than 30.

  6. Count. There are 5 distinct values of k.

Answer: 5

Option-wise explanation

  • a: incorrect — This counts only Case A (p = 2), which gives k = 3, 7, 13, 19. It misses k = 2 with p = 3, where 3² + 2 = 11 is prime. This is the most common trap: students fix p = 2 and forget that k can be the even prime instead.
  • b: correct — Parity forces either p = 2 or k = 2. p = 2 gives k = 3, 7, 13, 19. k = 2 works with p = 3. That makes 5 values of k: 2, 3, 7, 13, 19.
  • c: incorrect — Getting 6 needs one extra value. This usually comes from wrongly accepting a non-prime sum such as 9, 15, 21 or 27, or 6 from p = k = 2. Each of these is a multiple of 3 (or even), so none is prime.
  • d: incorrect — Getting 7 means counting 2 extra values. That happens if you list every prime k below 26 without checking that 4 + k is prime, or if you drop the 'less than 30' limit and accept larger sums.

How to eliminate

Use parity first. An odd prime plus an odd square is even, so one of p and k must be 2. That turns an open search into two short lists.

  • p = 2: test 4 + k for k = 3, 5, 7, 11, 13, 17, 19, 23. Every other sum (9, 15, 21, 27) is a multiple of 3. That pattern speeds up the check. The four that work are k = 3, 7, 13, 19.
  • k = 2: only p = 3 and p = 5 need checking. 11 is prime, so k = 2 is a fifth value.

If you stop after the p = 2 case you get 4, which is one of the options. That option is the trap, so always check the second case before marking. Since 4 is the trap, and 6 or 7 would need non-primes to pass the test, the only consistent answer is 5.

About 45–75 seconds once you see the parity point. Attempt this question on your first pass. It is short, certain and needs no heavy arithmetic.

Know more

Parity of primes: 2 is the only even prime.

When a question asks for a sum of primes (or powers of primes) to be prime, check parity first:

Terms Sum Can it be an odd prime?
odd + odd even No (unless the sum is 2)
odd + even (2) odd Possible
even + even (2 + 2) 4 No

So in a + b = odd prime, one term must be 2. This holds for p² + k, p + q, p³ + q and similar forms, because squaring or cubing does not change parity.

Second filter: multiples of 3. When the sum is 4 + k with k a prime above 3, k ≡ 1 or 2 (mod 3). k ≡ 2 (mod 3) makes 4 + k divisible by 3. Use this to discard cases quickly.

Worked variant. p and q are primes and p + q² is a prime less than 20. How many values can p take?

  • One of the two must be 2.
  • q = 2: p + 4 < 20 → p = 3 (7), 7 (11), 13 (17). p = 5 gives 9 and p = 11 gives 15, both ✗.
  • p = 2: 2 + q² < 20 → q = 3 gives 11 ✓.
  • Values of p: 2, 3, 7, 13 → 4.

Checklist: (1) apply parity to make one term 2; (2) run both cases, 'first = 2' and 'second = 2'; (3) apply the upper bound; (4) count distinct values of the variable asked for, not pairs.