The younger person's number in the ten's place multiplied by 2.5 years. If the older person's age is within the number of years of the calculated person then it is okay.
If:
person 1 is aged 31
person 2 is aged 23
we have (2) x 2.5 years = 5 years
The oldest person I'd say is acceptable for a 23 years old to date would be 28, so not acceptable.
Here's my breakdown, If the younger person is in the age range of... then they are allowed to date ... years older:
0-9/0 (no dating)
10-19/2.5
20-29/5
30-39/7.5
40-49/10
50-59/12.5
60-69/15 (at around this age, I think they're out of the dating game)
70-79/17.5
80-89/20 (by this range, They should be out of the dating game)
90-99/22.5 (I'm not sure there are any 121.5 year old that are thinking of dating >.<)
at age 16, up to 19 (16.5+2.5=19)
at age 24, up to 29 (24+5=29)
The youngest I could go is 20.
This really doesn't have much to do with the maturity of the people, but the age range of the people around them. When I hear a 23 year old is dating a 15 year old I don't think, 'that music be one mature 15 year old', I think 'that must be one immature 23 year old.' in your friends case of 16 to 21: unacceptable, but I'd be okay with both dating 19 year olds; That's reasonable.