I didn't know that a general formula exists, but it sounds about right for a diesel, subject to the usual caveats about hull speed and engine efficiency. (Yanmar 1GM7 = 6.5hp uses 2 pints per hour at 3-4 knots.)
This may be a good rule for horsepower produced but not for rated HP. We tend to use 1.5 litres/hour at cruising speed 5-6 kts. with a 20 HP Betamarine engine. The previous MD2 used 1/4 gal./hr. but we may have tended to go a bit slower to keep the racket down.
the term for this is 'specific horesepower' or some such. in the yanmar brochure they publish graphs of it, it varies from one engine to another and the revs being used.
i reckon my 27hp engines use 2.5 ltrs/hour at cruising revs but i couldn't tell you what power they are developing at those revs (cruising 2750 rpm, max 3600)