For maximum apparent detail, what you want is for the image dimensions to take full advantage of the highest resolution screen you want to show the slide show on.
If that will be a 1080p projector, then the image dimensions should fill a 1920 x 1080 box. A wide 16:9 image will naturally need to be 1920 x 1080. If you want full detail on a 4K TV, then the image should fill a 3840 x 2160 px box.
I keep saying “fill” because the only time your image fully occupies that 4K TV screen is if it is exactly 16:9 proportions. If you are showing uncropped photos off a 3:2 sensor, or a image shot vertically, then there will be black bars on the sides due to the aspect ratio mismatch.
A vertical photo on a 4k screen doesn’t need to be more than 2160px tall if you don’t need to zoom in.
If you do want to be able to zoom in during the slide show, then add your max desired zoom factor. For example if you want to allow showing full detail if zoomed in to 2x during slide show, then double the linear image dimensions. For a 4K screen, an image allowing full detail at 2x zoom should fit 7680 x 4320.
If you must think about dpi, the truth is, for slide shows, the dpi is wholly determined by the size of the projected image and it changes with every screen size, so setting the dpi in the image does nothing. The same image on a 27” TV has double the ppi as on a 54” TV, just because the same pixels are 2x as dense on the 1/2 size of the 27” TV compared to 54”.
If you show a 1920 x 1080 image through a projector that is projecting an image 6 feet wide, then the dpi at the screen can only be one number: 26.6 dpi (1920 pixels divided by 72 inches). But that image will appear sharp to your eyes if you are sitting several feet away. The 26.6 dpi will only look low res if you have walked right up to the projector screen.
Although dpi is important in print, it is based on the normal handheld reading distance for print, not watching TV or projector at a distance. If the 1920 x 1080 image is printed 6 inches wide, then its print dpi is 320 dpi, 1920 dots per 6 inches or 1920/6.