Darryl had 5/6 as many pennies as David. When David gave half of his pennies to Darryl, he had 45 fewer pennies than his friend. How many pennies did David have at first?

Let David has x pennies

then Darryl has = 5/6x
Now, after giving half pennies to Darryl,
David has = x/2
Darryl has = 5x/6 + x/2 = (5x + 3x)/6 = 8x/6 = 4x/3
So, 4x/3 - x/2 = 45 = (8x - 3x)/6 = 45 = 5x/6 = 45 => x = (45 * 6)/5 = 54
So, David had at first = 54 pennies