Take the value of a perpetuity that pays $100$ every year and subtract from it the value of a perpetuity that pays $100$ every three years.
The value of the perpetutity that pays $100$ at the end of a year and every year thereafter is $$\sum_{i=1}^\infty \frac{100}{(1+r)^i}.$$ To compute this, use the geometric sum formula $$ \sum_{i=1}^\infty \frac{1}{x^i} = \frac{1}{x-1}$$ valid for $x>1.$ Plugging in $x = (1+r)$ gives a value of $$ \frac{100}{(1+r)-1} = \frac{100}{r}.$$
The value of a perpetuity that pays $100$ every three years is $$\sum_{i=1}^\infty \frac{100}{(1+r)^{3i}}$$ since $100/(1+r)^3$ is the discounted value of the first payment, $100/(1+r)^6$ for the second payment after $6$ years, etc.
Since $1/(1+r)^{3i} = 1/((1+r)^3)^i$ we can evaluate the sum with the geometric sum formula plugging in $x=(1+r)^3.$ So the value is $$ \frac{100}{(1+r)^3-1}.$$
The perpetuity in question pays only in years not divisible by three, so it is the same as a perpetuity that pays every year minus one that pays every three years. So the value is $$ \frac{C}{r} - \frac{C}{(r+1)^3-1}$$