Answer :
The answer is the least common multiple of the number of days each cousin visits.
To find LCM, first find the prime factorization of the two numbers.
42=2*3*7
429=3*11*13
Next, create the prime factorization of the LCM with all of the factors from the original two numbers.
2*3*7*11*13=6006
You don't need to repeat the 3 even though it's in both prime factorizations because each number (of 42 and 429) can still be individually divided out of 6006 one factor at a time. If one of them had the same factor repeated more times than the other (say, your first number had three 3's in its prime factorization and your second number had only one), than you would need to include the greater number of repetitions (in the case of my example, three 3's would need to be in the prime factorization of their LCM).
To find LCM, first find the prime factorization of the two numbers.
42=2*3*7
429=3*11*13
Next, create the prime factorization of the LCM with all of the factors from the original two numbers.
2*3*7*11*13=6006
You don't need to repeat the 3 even though it's in both prime factorizations because each number (of 42 and 429) can still be individually divided out of 6006 one factor at a time. If one of them had the same factor repeated more times than the other (say, your first number had three 3's in its prime factorization and your second number had only one), than you would need to include the greater number of repetitions (in the case of my example, three 3's would need to be in the prime factorization of their LCM).