I agree with changing formula as S26gold is renouned for constipation
However I think such severe constipation so young is quite unusual and would be weary about the need to give medication to such a young baby.
I would be getting bubs reviewed by a Paediatrician or at a Children's Hospital if possible if things don't improve promply. Espescially if Bubs is more sleepy, has episodes of looking pale between the screaming / pulling legs up episodes, if you note their tummy to be distended or they start vomiting at all (espescially if it's bright green vomit)
Sorry to sound bit alarmist, but it is unusual for one week old to have constipation requiring medication, and then to be experiencing pain again so soon even after a decent poo