← All problemsSign in

Revised Fibonacci sequence

Implement a revised Fibonacci sequence using the following definition: Given terms t[i] and t[i+1] where i is an integer , term[i+2] is computed as: t[i+2] = t[i] + (t[i-1])2 Given three integers t1,t2 and n compute and print the nth term of a revised Fibonacci sequence. Example: t1=0 t2=1 n=6 t3= 0+12 =1 t4=1+12=2 t5=1+22=5 t6=2+52 =27 Return 27 Input Format: A single

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