← All problemsSign in

Finding Exponent

Professor Calculus gives the following problem to his students: given two integers X (≥ 2) and Y (≥ 2), find the smallest positive integral exponent E such that the decimal expansion of XE begins with Y. For example, if X = 8 and Y = 51, then X3 = 512 begins with Y = 51, so E = 3. It is easy to see that neither E = 1 nor E = 2 will satisfy this property, so 3 is the smallest possible value of E in

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