# Linear interpolation of a list between periodic anchorpoints

I have a list of the form:

list = {1,1,1,2,2,2,3,3,3,4,4,4,7,7,7,19,19,19};

Where we can see that there are an ordered set of integer values that repeat themselves some fixed number of times N. Is there a nice one-liner to transform this list into something like:

transformedList = {1,1+1/3,1+2/3,2,2+1/3,2+2/3,3,3+1/3,3+2/3,4,4+1/3,4+2/3,7,7+1/3,7+2/3,19,19+1/3,19+2/3}

Where we essentially choose each new element we come by in the list as an anchorpoint, and replace the repeats of that element as equispaced points along a line the anchor integer value and the next higher integer?

• You say "equispaced points along a line between each successive pair of anchor points", but you transform $4,4,4,7$ to $4,4+\frac13,4+\frac23,7$ instead of $4,5,6,7$. – user484 Aug 8 '13 at 2:00
• Rahul is right; something doesn't add up here. If your sample output is really what you want we should rephrase this question to match. Is it? – Mr.Wizard Aug 8 '13 at 2:06
• @RahulNarain Ahhh... I'm so sorry. – Niniar Aug 8 '13 at 2:06
• @Mr.Wizard I have updated the example, terrible mistake. – Niniar Aug 8 '13 at 2:07
• @Niniar Since I already answered your original question would you mind posting a new one with the revised information, and restoring this one to the original? – Mr.Wizard Aug 8 '13 at 2:10