Explanation
The sequence above consists of two alternating sub-sequences (skipping one number).
Pattern 1 (Odd positions)
42,39,34,27,...The differences between consecutive terms are:
39−4234−3927−34=−3=−5=−7
The pattern is subtracting consecutive odd numbers (−3,−5,−7). Thus, the next difference is −9. Next term: 27−9=18.
Pattern 2 (Even positions)
40,36,30,22,...The differences between consecutive terms are:
36−4030−3622−30=−4=−6=−8
The pattern is subtracting consecutive even numbers (−4,−6,−8). Thus, the next difference is −10. Next term: 22−10=12.
So, the next two numbers are 18 and 12.