  We derive a closed formula for the Heegaard Floer correction terms of lens
spaces in terms of the classical Dedekind sum and its generalization, the
Dedekind-Rademacher sum. Our proof relies on a reciprocity formula for the
correction terms established by Ozsvath and Szabo. A consequence of our result
is that the Casson-Walker invariant of a lens space equals the average of its
Heegaard-Floer correction terms. Additionally, we find an obstruction for the
equality and equality with opposite sign, of two correction terms of the same
lens space. Using this obstruction we are able to derive an optimal upper bound
on the number of vanishing correction terms of lens spaces with square order
second cohomology.
