585=5*9*13. When the remainder is 1 less than the divisor then we can write N+1=5X; N+1=9Y; N+1=13Z where N is the number and X, Y, Z are integers, because 4=5-1, 8=9-1 and 12=13-1.
So N=5X-1=9Y-1=13Z-1. If N=584, for example, 5 divides with a remainder of 4, 9 with a remainder of 8 and 13 with a remainder of 12, because 5*9*13=585. 584 divided by 585 is, of course, 0 remainder 584.
585n+584 is 585(n+1)-1. So the remainder is 584 each time, and since 5, 9 and 13 all divide into 585(n+1), the remainder will always be 4, 9 and 12 respectively.