I have a sequence as follows:
$$1, 2, 4, 4, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16, 32, 32 ...$$
What will be the closed form of the above sequence for the nth term?
I clearly see the pattern of $2^x$ getting repeated $2^{x-1}$ times. But I am getting confused in finding the closed form of this sequence.
EDIT:
Thanks @Arthur for providing the closed form. Now to extend the questiona bit further, what would be the sum upto nth term given the closed form?.
Looking at the closed form, it seems like that the sum would be of the order of $N^2$, but not able to find the exact value. I would like to see how much difference would it make because of the "ceiling" function.