The pentagonal numbers are the integers given by p 5 (n) = n(3n − 1)/2 (n = 0, 1, 2, . . .). Let (b, c, d) be one of the triples (1, 1, 2), (1, 2, 3), (1, 2, 6) and (2,3,4). We show that each n = 0, 1, 2, . . . can be written as w+bx+cy+dz with w, x, y, z pentagonal numbers, which was first conjectured by Z.-W. Sun in 2016. In particular, any nonnegative integer is a sum of five pentagonal numbers two of which are equal; this refines a classical result of Cauchy claimed by Fermat.