← Amazon questions

Print the nth element of series 1, 1, 2, 4, 8, 16, 32

Filed under Amazon

Given $n$, write a function to find the $n$-th element of the series: 1, 1, 2, 4, 8, 16, 32, ... Note that the sequence starts with two 1s, followed by powers of 2.

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 Amazon questions

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