← All problemsSign in

GENERATE THE SEQUENCE

Mathematics Department of Harvard is developing a sequence popularly known as The Sequence X. Your task is to help the department by making a program that automatically generates the sequence X. The sequence comprises of a starting integer followed by some sequence of integers. The integers in the sequence will be calculated as: . For every even integer, divide the number by 2. For every odd 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