Okay, so we know that n is the number of bars we want to buy. The sum of the numbers of bars we buy is $1.29n where n is the number of bars we buy. Its the same as saying:
$1.29 + $2.58 + $3.87... $1.29n
↑ ↑ ↑ ↑
Bar 1 Bar 2 Bar 3... Bar n
So as you can see, our function is:
C(n) = $1.29n