Microsoft Corp co-founder Paul Allen has accused his former business partner Bill Gates of plotting to dilute Allen's stake in the world's largest software company before he left in 1983, and tried to buy his share of the company on the cheap.

Allen, who now runs a Seattle-based investment firm and philanthropic foundation, makes the claim in a forthcoming book of memoirs, excerpts from which were published in Vanity Fair magazine on Wednesday.

Allen, 58, says he overheard a heated conversation between Gates and now Chief Executive Steve Ballmer in December 1982, shortly after Allen told them he was thinking of leaving the company.

It was easy to get the gist of the conversation, writes Allen in the memoir as reproduced in Vanity Fair. They were bemoaning my recent lack of production and discussing how they might dilute my Microsoft equity by issuing options to themselves and other shareholders. It was clear that they'd been thinking about this for some time.

Allen, who at that time was receiving treatment for Hodgkin's lymphoma cancer, and was scaling back his work at Microsoft, says he later received apologies from both Gates and Ballmer over the incident.

Allen, who made up the name Microsoft, co-founded the company with Gates in 1975. Two years later, he and Gates agreed to take 36 and 64 percent shares in the company respectively, Allen says in the book, owing to Gates' greater contribution to their first coding job for the new Altair computer, which turned out to be the company's first big break.

The two men's holdings in Microsoft were later diluted as more people joined the company and it issued shares publicly in 1986.

As the company grew, the two clashed over the hiring of Ballmer -- a friend of Gates' from Harvard -- to lead sales and marketing efforts in 1980.

Allen claims in the book that they agreed to give Ballmer no more than 5 percent equity in the company, but says Gates went behind his back to offer Ballmer 8.75 percent.

It was bad enough that Bill had chosen to override me on a partnership issue we'd specifically discussed, says Allen in his book. It was worse that he'd waited till I was away to send the letter.

Allen says Gates eventually made up the extra equity given to Ballmer from his own share. Ballmer became CEO in 2000, and is the second-largest individual shareholder behind Gates.

Before he left Microsoft in 1983, Allen claims Gates attempted to buy his shares from him at a bargain price.

It's not fair that you keep your stake in the company, Allen reports Gates as saying, making what Allen described as a lowball offer of $5 a share for his stock. Allen says he wouldn't go below $10. As a result, Allen says he kept his share.

As it turned out, Bill's conservatism worked to my advantage. If he'd been willing to offer something close to my asking price, I would have sold way too soon, says Allen in the book.

Gates, who has recently been traveling in India working on his own philanthropy projects, did not directly contest Allen's account, but sought to play down friction.

While my recollection of many of these events may differ from Paul's, I value his friendship and the important contributions he made to the world of technology and at Microsoft, Gates said in an emailed statement.

A Microsoft spokesman declined to comment.

Allen is ranked the 57th richest person in the world with a fortune of $13 billion, according to Forbes magazine, largely due to his Microsoft holdings. Gates is ranked No. 2 with $56 billion.

Allen's book, titled Idea Man, is set to be published later this month by Portfolio.

(Reporting by Bill Rigby; Editing by Tim Dobbyn and Richard Chang)