Beginning with prime=2, the first n after 2 is 3 and from n=3 to next prime >n is 5, with distance from 3 to 5=2. Next n after prime=5 is 6, so that distance to next prime 7 = 1.

EXAMPLE

a(2)=3 because when n=8 (8 is next n after prime 7), next prime is 11 and distance is 3