solution to p8: 40824
solution calculated algebraically to be 31875000