← All problemsSign in

Jaime and his numbers

Jaime and his numbers Jaime Lannister is an intelligent guy .He likes to play with numbers . He made an interesting sequence of numbers in which the first two numbers are 1 and 2 and the other numbers are generated according to following rule : "If A[i] is the ith (for i>2) element in the sequence then ' i ' occurs A[i] times in the sequence and A[1]=1 and A[2]=2" . First few terms in sequence

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