1. The sequence 2, 3, 5, 6, 7, 10, 11, $\ldots$ contains all the positive integers from least to greatest that are neither squares nor cubes. What is the $400^{\mathrm{th}}$ term of the sequence?
2. The first digit of a string of 2002 digits is a 1. Any two-digit number formed by consecutive digits within this string is divisible by 19 or 31. What is the largest possible last digit in this string?
1) First list ALL consecutive numbers from 2 to the 400th term, which is 401. Then subtract all the squares of all numbers 2 to 20, which come to 19 numbers that are squares. Then subtract all the cubes of all numbers from 2 to 7, which come 6 numbers that are cubes.
So, you have: 401 - 19 - 6 =376 terms ending in 401. Then replace the 25 square and cubes with 25 numbers added to 401. Or: 401 + 25 =426, which should be the 400th term of your sequence.
Note: All the numbers from 401 to 426 contain no squares or cubes.