In the stock market, certain patterns tend to repeat over the long term. And if you analyze Nasdaq
Composite
data going back to 1971, the tech-heavy index has risen by 19% every year after a recovery year like the one in 2023. This trend suggests that 2024 could be an ideal year to buy stocks, especially as macroeconomic headwinds like inflation and high interest rates eventually start subsiding.

AI-related companies like Nvidia (NVDA 6.18%) and Palantir Technologies (PLTR 3.73%) could be a great way to bet on the pattern continuing. Let's discuss their growth catalysts for this year and beyond.

Nvidia

After a spectacular bull run in 2023, Nvidia also started 2024 with a bang, with its shares rising 24% in January. The company still enjoys widespread optimism about its fast-growing artificial intelligence (AI) chip business. And while competition is set to increase, Nvidia still has what it takes to maintain its long-term advantages.

With an over-80% market share in the graphic processing units (GPUs) used to run and train AI applications, Nvidia has seen its operational results surge. Third-quarter revenue jumped 206% year over year to $18.12 billion, while net income increased to $680 million. Unsurprisingly, those juicy profits are attracting competition from new rivals. But Nvidia is in a prime position to maintain its lead.

Nvidia's longtime competitor Advanced Micro Devices wants to tackle the AI chip opportunity with its MI300x family of GPUs, launching this year. But the company expects to generate around $2 billion from the new product -- a tiny fraction of the $45 billion AI chip market. Nvidia's industry dominance also gives it an economic moat because of the significant amount of developers who are familiar with its hardware and have designed their software and servers to work best with its chips.

With a forward price-to-earnings (P/E) multiple of 30, Nvidia is relatively cheap, considering its eyewatering growth rate. For context, the NASDAQ 100 has an average forward P/E of 29.

Palantir

Like Nvidia, Palantir is also enjoying a bull run, with its stock price up almost 140% over the last 12 months based on its burgeoning profitability and ambitious AI efforts. While the company doesn't produce AI chips, it is a great way for investors to bet on the adoption of the technology in government agencies and the armed forces.

While it is tempting to focus on the surging market for AI-enabling hardware, investors shouldn't lose sight of the software side of the industry, where the tech will be adapted for various end users. Palantir's moat comes from its track record of working on highly sensitive national security missions like tracking down Osama Bin Laden in 2011 and helping the Ukrainian military with targeting during its war with Russia.

Analyst looking at a giant computer screen at night

Image source: Getty Images.

To better serve clients, Palantir has built its new Artificial Intelligence Platform (AIP), designed to combine its legacy machine learning tools with large language models -- allowing it to give real-time insights in time-sensitive scenarios, such as a battlefield or combat mission.

Palantir's third-quarter net income increased from a loss of $123.9 million to a gain of $73.4 million, capping off the company's first consecutive four quarters of profitability according to generally accepted accounting principles (GAAP). While the stock is quite pricy with its forward P/E of 58, it should be able to scale into its valuation as its new AI growth drivers gain steam.

Nvidia is still the winner

While Palantir and Nvidia both offer investors a way to bet on the continued growth and industry adoption of artificial intelligence tech, Nvidia remains the best pick for most investors. While it can be intimidating to buy a stock that has already risen so far so fast, Nvidia's current performance and future potential fully justify the rally.

Palantir's respectable growth and push toward profitability are also encouraging, but its P/E multiple of 58 makes it a weaker value compared to Nvidia's P/E of just 30.