Dear Allan and Maximilian, Thank you. I agree with your reasoning. Sequence a(n) for q=0 is A002110(n). Correction of a(n) for q>0: a(n) is the smallest k such that number of some divisors m of k is equal to excatly n where m = n < A000005(k) and m-q, m+q are both prime. JSG.