Pergunta de entrevista da empresa Jamcracker

how will you write a code for giving input 4 it'll give result as 1+2+2*2+2*2*2+2*2*2*2