← All problemsSign in

Prime Challenge

Samya and Utsav are good friends. Samya claims that no one can beat him in maths especially when it comes to dealing with numbers. So Samya throws a challenge at Utsav that he will be able to do any computation within a second however difficult it is. Utsav tells him a value of N and asks him to find the smallest number such that it is co-prime to all first N natural numbers,it is a composite numb

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start