Great question. This is still not proved to be in polynomial time (polynomial in the number of digits, here 20) — this was the Finding Primes Polymath project, where several mathematicians (including Fields Medallists Terence Tao and Tim Gowers!) tried to come up with an algorithm, but the project doesn't seem to have had any concrete results yet.
Anyway, there are several things you can do. One of them, as you and others have pointed out, is to try each number and check whether it's prime, with a fast primality test like Miller–Rabin. By well-known number-theoretic heuristics (based on the prime number theorem), the "probability" of a number near n being prime is around 1/ln(n), so with 10^20, about in every 46 numbers will be prime. So if you want k 20-digit numbers, you'll run the Miller-Rabin test on about 50k numbers.
The second approach, which I think might be faster if you're doing this for many many A's (haven't thought carefully) is to instead use a sieve, like the Sieve of Eratosthenes. If you want k primes, make an array with about 50k numbers (or more to be safe), and sieve through them. You'd start with a precomputed list of primes less than some number. (1010 to be perfectly correct, but since you're willing to tolerate some composite numbers, a smaller list of prime numbers will do, e.g. testing by the first 50 million primes, ensures your numbers have no prime factors below 982,451,653, and there aren't many of them.)
The third approach is to find someone else's implementation for this problem. :-) For example, there's a webpage that given a number, finds the next prime number or finds the next ten prime numbers. If you use it online it appears you'll have to copy them down by hand, but the source code is available too.