MATLAB: Logaritmical spacing / incremented spacing

incremented spacinglog spaceMATLAB

Dear all,
I wish to write a code where I have two values, 0 and 1. Lets say I have a 500×1 array called A.
The code should be distributing the values of 1 logaritmically spaced in the array A. Where there is no 1 the program would put 0.
Something like
A=[1; 0; 1; 0; 1;0;0;1;0;0;1;…..0;0;0;0;0;0;1;0;0;0;0;0;0;1;…….0;0;0;0;0;0;0;0;0;0;1;…A(xn,1)]; where xn = 500.
I know what I did is a logaritimical spacing, its more like an incremented spacing;
My question would be, which would be the easiest way to achieve this. I made something but it needs a prebuilt CSV file which containts the positions of 1 and 0. But to do this for 500 numbers and to consistently increase the spacing it can take some time.
I hope this makes sense, if not please let me know and I will try my best to clarify what I mean :).
Thank you all in advance for your time and help.
Best wishes,
Ors.

Best Answer

>> diff(fix(log2((1:32).')))
ans =
1
0
1
0
0
0
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1