2
$\begingroup$

In a $365$-day year, Joe, Greg & Dean visit the park multiple times for a walk.

  • Joe visits every $3$rd day
  • Greg visits every $5$th day
  • Dean visits every $7$th day
  • All three visit the park on the first day of the year

In the year:

  • On how many days is Greg alone in the park?
  • On how many days will Dean meet Joe?
  • On how many days will all three meet?

I can work this out brute force by laying down the multiples of $3,5,7$ from $1$ to $365$. I'm looking for an efficient way of formalizing the calculation step by step. What'd be the best way?

  • 0
    Are you familiar with the Inclusion-Exclusion Principle?2010-10-30
  • 0
    Nopes :( Any clues/references?2010-10-30
  • 1
    Use the chinese remainder theorem to solve the set of congruences. The days are prime for a reason :D2010-10-30
  • 0
    For inclusion/exclusion, look at Wikipedia2010-10-31

1 Answers 1