Hahn subroutine for CP sequence