Without considering too many of the other indirect cost factors suggested above, there are quite enough potential direct cost variables that a simple distance x 4p or 7p /seat mile is far too simplistic.
Any airline's cost for any particular flight needs to take account of large variations in landing fees, parking fees, handling charges, fuel costs, airport's other charges, en-route and navigation charges and the cost of the aeroplane (is it a brand new 787 or a fully paid off 25 year 737 dog) given the aforementioned black-art algorithm means that on any given flight the first few seats will be at a loss (to quote in the advertising) and the last few at a very healthy profit.
I don't know the answer either, but it's not anywhere near as simple as you suggest.