You asked

How does the 40mm f 2 8 pancake compare with a 50mm f 1 8 on a pentax k 3 mark iii?

On the Pentax K-3 Mark III, which has an APS-C sensor, the 40mm f/2.8 frames like 60mm on full frame, and the 50mm f/1.8 frames like 75mm. The 50mm also gives more background blur. At the same framing, f/1.8 on APS-C gives about the depth of field of f/2.7 on full frame, while f/2.8 gives about f/4.2 (focal length converter). The 50mm therefore lets in more light and separates a person from the background more easily, which matters most indoors and in dim light.

The catalogue lists two 40mm f/2.8 lenses for this camera: the Pentax smc DA 40mm f/2.8 XS and the Pentax HD DA 40mm f/2.8 Limited. The guide's pages don't say which of these is the pancake, so check the lens pages before buying. Neither gives the 40mm an advantage in light or blur over the 50mm.

For most people photographing people, food and everyday scenes, the Pentax smc DA 50mm f/1.8 is the better pick. The guide's first-lens advice names a fast standard prime around 33 to 35mm equivalent on APS-C, and the 50mm sits close to that framing, just a little tighter (lenses). Choose the 40mm only if you specifically want the slightly wider framing and a smaller lens, and accept less light and less blur in return.

Whichever you choose, the guide suggests spending about as much on lenses as on the body (first camera). The K-3 Mark III page lists the full range of lenses that fit it.

Written by Claude from this site's pages.

From these pages

This answer is for the question above. Each answer is written for the exact question in its address, so a question with its details in it (a budget, what you shoot, what you already have) gets an answer about those details. An answer draws on all 15 pages of the guide and its catalogue of 320 cameras and 1050 lenses. Another question gets its own answer at its own address, as words after /ask/. Or fill in your own: /ask/which-camera-for-{what-you-shoot}-under-{budget}-euros or /ask/which-lens-for-{what-you-shoot}-on-{your-camera}.