Binary output challenge

output
5
125
893
65405

this is the output coming i have already send you the code and i think the logic is correct