Merge square numbers