I am trying to calculate a learning plan, based on following user inputs:

- Deadline
- Repetitions

Then I would calculate dates for repetitions in the order, that the time till next repetition the Double of the previous is, for example 2, 4, 8, 16 day delays.

As output I would like to return a learning Schedule.

Here’s my Matlab code for this operation(there are bit more inputs):

```
deadline = 28;%days till deadline
x =0;%first review delay
r = 4;%number of reviews
c = 2; %review multiplyier
sum_buffer = 0;
for i = 1:r
sum_buffer = sum_buffer + c^(i-1);
end
x = deadline/sum_buffer;
reviews = 1:r;
for z = 1:r
reviews(z) = round(x*c^(z-1));
fprintf('reviev %d: %d\n', z, reviews(z));
end
```

Thank you very much for your response!