P-ary Subdivision Generalizing B-splines