The president appeared delighted with his own arithmetic skills, but social media users were considerably less impressed.