Assignment of the 13C NMR of 2-heptanone
For open chain alkanes, chemical shifts in 13C are dependent on substituents at the &alpha;, &beta; and &gamma; positions. &alpha; substituent effects are largely correlated to electronegativity. &beta; substituents cause a shift of similar magnitude, but are not related to electronegativity. In fact a number of studies have shown an inverse relationship to electronegativity, but this is not consistent. The origins of the &beta; effect are unclear. The downfield shift is larger for primary/secondary carbons than for tertiary/quaternary (hence the larger downfield shift for C-5 which has 2 &beta; carbons). The &gamma; effect is small and has a dependence on sterics of the bonding pathway.

The chemical shifts for straight chain alkanes can be calculated quite accurately using additive tables (such as in Pretsch, or used by Chemdraw etc). As a &beta; substituent, an alkane -CH2- has a shift increment of +9.4, versus -C(O)- having an increment of +0.5. Hence your difference of about 8ppm for carbons 3 and 5.

From Chemdraw

Node     Shift    Base + Inc.   Comment (ppm rel. to TMS)
CH2     22.9         -2.3      aliphatic
                     18.2      2 alpha -C
                      0.5      1 beta -C(=O)-C
                      9.4      1 beta -C
                     -2.5      1 gamma -C
                     -0.4      general corrections
CH2     31.3         -2.3      aliphatic
                     18.2      2 alpha -C
                     18.8      2 beta -C
                     -2.7      1 gamma -C(=O)-C
                     -0.7      general corrections