I need to calculate the value an item in a log() list based on how much the item added to the list. Example, I have a list like this (using integers, not floats, for simplicity sake);
>>> import math
>>> [int(math.log(1 + n) * 4) for n in range(1, 10)]
[2, 4, 5, 6, 7, 7, 8, 8, 9]
I want a list like [2, 2, 1, 1, 1, 0, 1, 0, 1]
, ie, it needs to look at the previous element in the list to get the values.
This is going to be used almost like the example, but with a much bigger list. So the ultimate solution would a mathematical
way of doing this, not creating a python-function to do the job.