Put the flour, sugar and salt in a food processor and whizz briefly with the butter, then add the egg and just enough cold water (one to two tablespoons) to bring it together into a dough. Alternatively, rub the butter in by hand, then stir in the egg and water. Form into a disc, wrap and chill for at least 30 minutes.
Meanwhile, core and peel 400g of the apples and cut into chunks. Put in a pan with the butter, 75ml water and the vanilla pod, if using, and cook over a low heat until very soft, adding more water if necessary. Puree with a stick blender or mash well, and leave to cool.
Grease a 25cm, fairly deep tart tin. Roll out the pastry on a lightly floured surface to about 5mm, and line the tin with it, pressing it in without stretching it and leaving some overhang. Prick in several places with a fork, and put in the fridge to chill.
To make the frangipane, beat together the butter, icing sugar and almond essence until fluffy, then whisk in the egg. Fold in the remaining ingredients and a pinch of salt, and mix until well combined.
If you’re feeling fussy, peel the remaining apples, but you really don’t have to, then core them, cut in half and slice to about 3-4mm thick.
Heat the oven to 200C/390F/gas 6. Spread the pastry base with the apple puree and top with the frangipane mixture. Finally, top with the apple slices in two concentric overlapping circles, with a few in the middle, then bake for about 30 minutes, until golden brown.
Heat the jam over a low heat until runny, then carefully brush the apples until glossy.