(CNN) The irony in President Donald Trump's hostility to immigration, expressed again in reports of his vulgar comments about Africa and Haiti last week, is that in appealing to the racial and cultural resentments of his political base he is directly threatening their economic interests.

The equation is unmistakable: as America ages, the older and blue-collar whites at the core of Trump's electoral coalition in 2016 need more working-age immigrants to pay the taxes that fund Social Security and Medicare.

Without robust immigration, each American worker will need to support substantially more retirees in the future than workers do today. And that will greatly increase the pressure for either unsustainable tax increases or biting benefit reductions in the federal retirement programs that the older and blue-collar whites central to Trump's support rely upon so heavily.

Trump's hostility to immigration ignores one of the central dynamics of 21st century American life: an increasingly non-white workforce will pay the taxes that support Social Security and Medicare for a rapidly growing and preponderantly white senior population

"As every baby boomer retires over the next 15 years, we are going to need many more of these (diverse) young people to take their place," says William Frey, a demographer at the center-left Brookings Institution.

Frey and other demographers project the white share of the senior population will decline very slowly over the coming decades-even as the total number of seniors explodes. The Social Security Trustees have forecast that the number of seniors receiving Social Security and Medicare will grow from about 48 million today to 86 million by 2050. That's an increase of nearly 40 million.

JUST WATCHED Sanders: 'Immoral' for GOP to target social safety nets Replay More Videos ... MUST WATCH Sanders: 'Immoral' for GOP to target social safety nets 04:55

Though many Americans incorrectly think of the programs as a kind of massive 401(k) where their earlier taxes pay for their own later benefits, Social Security and Medicare are funded by what amounts to a generational compact. Each generation of workers, through their payroll taxes, funds the benefits for retirees at the same time. As the number of seniors increases, that means the US needs to increase the number of workers if it is to keep a sustainable balance between those receiving benefits from the programs and those paying the taxes that support them.

Because of the underlying child bearing and aging trends among native-born Americans, that won't be possible without immigration.

Frey has calculated that from 2000 through 2016 the absolute number of whites younger than 15 -- and not just the share -- declined in 45 of the 50 states. (The only states that increased their population of whites under 15 over that period were Utah, Wyoming, North Dakota, South Carolina and Idaho.) Over those years, the total number of whites younger than 15 fell by nearly 6 million, Frey found, while the number of Hispanic, Asian and mixed race kids increased by about seven million. (The number of young African-Americans slightly declined too.)

Like other demographers, Frey projects that the 2020 Census will find that non-white kids represent a majority of all Americans younger than 18; kids of color are already a majority of all K-12 public school students.

What these numbers make clear is that, whatever Trump does to restrict immigration, there is no cavalry of white kids coming to fill the jobs that the mostly white baby boom is vacating.

Non-white young people-reinforced by future immigrants-will drive almost all of the workforce's future growth, according to widely respected projections by the non-partisan Pew Research Center.

In a detailed forecast last year , Pew examined the trajectory of the prime working-age population -- that is, ages 25 to 64 -- over the next two decades. Strikingly, it found that over that period the number of prime working-age adults whose parents were both born in the US will actually decline by over eight million. But Pew projects that loss will be offset by increases in the number of both prime-working age adults who are either the children of immigrants (13.5 million), or future immigrants themselves (17.6 million).

Looking further ahead, Pew has calculated that under current levels of immigration, the workforce will increase by about 30 million people through 2065-virtually equal to the increase in the senior population over coming decades. Almost all of that workforce growth will come from immigrants and their children, which Pew projects to account for fully 88% of the nation's total population increase over that period.

JUST WATCHED HHS nominee: Trump should keep word on Medicaid Replay More Videos ... MUST WATCH HHS nominee: Trump should keep word on Medicaid 01:16

A growing workforce would ease the fiscal pressure that the expanding senior population will impose on Social Security and Medicare. But Trump's efforts to reduce legal immigration would consign the U.S. to virtually no growth in the workforce, Pew projects. Trump has endorsed legislation from Republican Sens. Tom Cotton of Arkansas and David Perdue of Georgia, two attendees at last Thursday's explosive White House meeting, that would cut the total level of legal immigration in half. Pew projects that under that level of future legal immigration, the size of the workforce will remain virtually stagnant over the next half century.

If the workforce remains essentially unchanged while the senior population grows by 40 million, each worker will be required to fund 80% more seniors than they do now. That demographic imbalance represents a political tourniquet that will inexorably increase pressure for cuts in Social Security and Medicare -- a prospect that polls show is anathema to the older and working-class whites Trump relies on.

"We shouldn't be shutting the door on this (immigration)," Frey says. "Trump ... is really putting us in a very difficult situation demographically and also economically in the future."

Yet Trump, like many congressional Republicans and conservative commentators, almost always portrays immigrants as economic, cultural and security threats. From the outset, Trump's coalition has been centered on the voters -- primarily older, blue-collar, evangelical and rural whites -- most uneasy about the growing number of immigrants and demographic change more broadly.

Voters who supported deporting all undocumented immigrants represented a minority in almost all the Republican primaries in 2016 -- yet provided a majority of Trump's votes in almost all of those contests.

Pew Research polls last year found that the strongest predictors of warm feelings toward Trump were agreement with the ideas that the growing number of immigrants "threatens traditional American customs and values," that Islam is inherently more violent than other religions and that growing diversity overall was bad for the country.

In the general election against Hillary Clinton, Trump won 26 of the 30 states with the smallest share of foreign-born residents and lost 16 of the 20 with the most. And in a national NBC/Wall Street Journal poll last September, Trump voters from 2016 were nearly five times as likely as Clinton voters to say immigration weakens, rather than strengthens, the nation.

JUST WATCHED Ryan says GOP will tackle entitlement reform Replay More Videos ... MUST WATCH Ryan says GOP will tackle entitlement reform 00:37

Trump portrays his drive to slash legal immigration as standing up for the economic interests of the American-born working-class. But the National Academy of Sciences, in an exhaustive study, found "little evidence" that immigration had affected employment levels for native-born workers, and a "very small" impact on the wages of lower-skilled Americans that was confined largely to native-born adults who had not finished high school and recent immigrants themselves, two relatively small groups.

Even Trump's call for prioritizing economically based immigration over family reunification obscures the central implication of his proposal -- which is to severely reduce the total number of legal immigrants. By contrast, the comprehensive immigration reform bill that stalled in the House after if passed the Senate with bipartisan support in 2013 tilted the overall balance more toward high-skills immigrants and limited some forms of family reunification without cutting total legal immigration, as Trump, Cotton and Perdue are demanding.

In his repeated appeals to nativist sentiments, and his multiplying efforts to reduce immigration and remove immigrants (such as those from El Salvador), Trump may indeed be reflecting the racial and cultural anxieties of many of his voters. But the principal economic impact of slashing immigration as deeply as Trump is seeking would be to destabilize the federal retirement programs that are indispensable to those same voters. With his systematic offensive against immigration, Trump is feeding the prejudices of some of his supporters -- while threatening their ability to keep food on the table when they retire.