Ron Jenkins/Associated Press

LOS ANGELES — As the Los Angeles Lakers try to stay competitive throughout the 2017-18 season, the eyes cannot help but wander to next July, when LeBron James, Paul George and DeMarcus Cousins are expected to be free agents.

Lakers team president Earvin "Magic" Johnson and general manager Rob Pelinka have long stressed that the team will hit 2018 free agency with the necessary space for two max-salaried players.

Based on the NBA's 2018 salary-cap projection of $101 million, James will get up to $35.4 million, while Cousins and George can top out at $30.3 million.

The math doesn't actually work for the Lakers, who are looking at roughly $47.5 million in space once they renounce the rights to Julius Randle, Brook Lopez, Kentavious Caldwell-Pope, Corey Brewer and Andrew Bogut while waiving Ivica Zubac, Thomas Bryant and Tyler Ennis.

A significant impediment to the $60-65 million necessary for two max players is the $36.8 million owed to Luol Deng over the next two seasons—starting at $18 million in 2018-19.

LM Otero/Associated Press

The good news for the Lakers is that few teams project to have significant cap space in July. That means fewer franchises vying for the same stars, but it also means there are limited destinations for Deng's salary.

As ESPN.com's Ramona Shelburne recently reported, Deng would welcome a move out of Los Angeles since he's well outside of head coach Luke Walton's rotation. If up to 10 franchises have the cap space necessary to take on Deng's contract, what kind of price would the Lakers have to pay to make a deal?

"I would say a [first-round pick] with a good chance to convey in the lottery," said an executive with another franchise. "I would say that's in addition to Julius Randle unless the protections were very favorable to the receiving team."

It cost the Lakers D'Angelo Russell to get out of Timofey Mozgov's deal, another ill-advised contract which the previous regime of Jim Buss and Mitch Kupchak handed out.

Los Angeles only has so many young players to deal. If the future is Lonzo Ball, Brandon Ingram and Kyle Kuzma, the Lakers may not have much else to offer outside of Jordan Clarkson and Randle.

Clarkson is under contract for two more seasons at a reasonable salary ($12.5 million and $13.4 million). Randle will only be a restricted free agent if the Lakers make him a qualifying offer of $5.6 million—but in doing so, he'll take up $12.4 million of their precious cap space.

Jae C. Hong/Associated Press

The Lakers may find a market for Randle. Last year, the Portland Trail Blazers traded a player in a comparable position (Mason Plumlee) to the Denver Nuggets for Jusuf Nurkic and a first-round pick. The Blazers also sent out $2.9 million to Denver in the deal. Plumlee ultimately re-signed with the Nuggets on a three-year, $41 million contract.

A team without cap room may similarly value Randle's restricted rights. While that team may be willing to pay him the $14 million a season Plumlee received, would it also be willing to pay out another $18.3 million to take on Deng over the next two seasons?

Probably not.

Salary dumps tend to be expensive in young talent, draft picks and/or cash itself.

The Miami Heat spent the league maximum of $5.1 million to dump Josh McRoberts' expiring deal on the Dallas Mavericks, enabling them to sign players like Dion Waiters and Kelly Olynyk. The Cavaliers recently sent out $3 million to the Atlanta Hawks just to clear the small salaries of Richard Jefferson and Kay Felder. The Toronto Raptors sent both a first- and second-rounder to the Nets to get out of DeMarre Carroll's contract, which expires after the forward earns $15.4 million for the 2018-19 season.

Johnson and Pelinka may try to find similar trades but with fewer teams flush with cap space, the market to dump contracts may get even tighter. The solution for the Lakers may be a loophole in the NBA's collective bargaining agreement.

As of July 7, Deng is eligible for a three-year extension. Given the need to get him off the books, why would the Lakers add on to his contract?

The answer is the league's stretch provision, which allows for players to be waived with their contracts paid out over twice the length of the remaining deal, plus one season.

With the $36.8 million owed to Deng over the next two, the Lakers can stretch him out to $7.4 million over five years, which would open $9.8 million in additional cap space in July.

That isn't quite enough to get to two max slots, putting the Lakers at about $57.3 million in space.

That's where a Deng extension can help, with the caveat that any additional salary doesn't have to be guaranteed. By adding three years to his deal with no extra money guaranteed, the Lakers would have the ability to stretch Deng's salary over 11 total years, at $3.3 million a season.

David Zalubowski/Associated Press

Now, without any difficult, expensive trades, Los Angeles would have enough space to pay both Cousins and George. They'd still be $4.3 million short the amount needed to pay James (with one of Cousins or George) unless the signing players were willing to give the Lakers a small discount.

Given the value of money, why would Deng be willing to defer his earnings over six additional seasons?

To entice Deng, the Lakers probably have to offer a partial guarantee over the extension to make it worth his while.

"If Deng takes a buyout from the Lakers, his income tax burden will be dependent on his state of residence," sports accountant Robert Raiola of PKF O'Connor Davies said. "It's not easy to predict his take-home pay after taxes, especially with proposed tax-code changes by President Trump."

"Depending on Deng's savviness as an investor, an additional $3 million in salary from the Lakers paid out over 11 years may be more than the net he would earn under his existing contract paid out over five years," Raiola continued.

Part of that computation is that Deng would be able to double-dip, eligible to sign with another team next season at a salary worth at least $2.4 million.

A three-year extension with $3 million in total guaranteed might be enough enticement, which is a judgment call the Lakers would have to make.

If so, paying that additional salary to Deng over 11 years is a better investment for the Lakers than sending an immediate $3-5 million in a trade to another team as part of a salary dump.

"It's clever," said one Western Conference general manager. "I wish I thought of it."

Giving Deng additional money could also help the Lakers ensure the league doesn't close the loophole in the CBA, according to Larry Coon, salary-cap expert and author of the CBA FAQ.

"The league's General Prohibition on Circumvention prohibits any transaction that's intended to defeat or circumvent the CBA's intent. ...Certainly, if there were no salary guarantees, the league would nix the extension as a blatant attempt to circumvent the rules. On the other end of the spectrum, a fully guaranteed extension easily would pass league muster, but it would be of no benefit to the Lakers. Somewhere between these two extremes is the tipping point—the point at which the league would allow the transaction."

The Lakers would be sacrificing future cap space, but to a small degree (less than 4 percent per year).

If Johnson and Pelinka need to increase the team's cap space in July, they can look to deal Clarkson. That might open up enough space to sign James and either George or Cousins, plus an additional $8.7 million that can be used to try and keep players like Lopez, Caldwell-Pope, Randle, Zubac and/or Bryant.

Given the scarcity of cap room around the league, the market for starting-caliber players like Randle, Lopez and Caldwell-Pope may be in the $8.6 million mid-level exception range. Once the Lakers do spend their cap room next summer, they'll gain a $4.4 million room exception, which can be used to sign a player for up to two years.

If Lopez took the room exception for a year, Los Angeles would retain his full rights in 2019, with the ability to re-sign him to much larger contract.

Whatever the path, the Lakers have no guarantees. Any deadline trades in February to open space in July won't be rescinded because superstars choose not to come to Los Angeles.

That's why the Deng loophole could reduce a lot of pressure on the Lakers. Call it a reverse buyout.

All quotes were obtained firsthand unless otherwise noted. Email Eric Pincus at eric.pincus@gmail.com and follow him on Twitter: @EricPincus.