The world’s largest chipmaker Intel Corp. will buy programmable chip maker Altera Corp. for about $16.7 billion in cash, the two companies said Monday. The deal continues a wave of consolidation in the semiconductor industry, as chipmakers grapple with rising costs and weak revenue growth.