  We obtain a general lower bound for the number of fixed points of a circle
action on a compact almost complex manifold $M$ of dimension $2n$ with nonempty
fixed point set, provided the Chern number $c_1c_{n-1}[M]$ vanishes. The proof
combines techniques originating in equivariant K-theory with celebrated number
theory results on polygonal numbers, introduced by Pierre de Fermat. This lower
bound confirms in many cases a conjecture of Kosniowski from 1979, and is
better than existing bounds for some symplectic actions. Moreover, if the fixed
point set is discrete, we prove divisibility properties for the number of fixed
points, improving similar statements obtained by Hirzebruch in 1999. Our
results apply, for example, to a class of manifolds which do not support any
Hamiltonian circle action, namely those for which the first Chern class is
torsion. This includes, for instance, all symplectic Calabi Yau manifolds.
