← Accenture questions

Find the nth term of the Collatz sequence

Filed under Accenture

Given a starting positive integer 'a' representing the first element of a Collatz sequence, write a function to calculate and return the nth term where P_(k+1) = P_k / 2 if P_k is even, and 3*P_k + 1…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Accenture questions

Collected from public candidate posts and coding forums. Updated Nov 2026.