#{x<=N:x is prime}=N/log(N)+o(1).

So floor(n/log(n)) tells you 'about' how many primes are less than n,

and floor((n+1)/log(n+1))-floor(n/log(n)) tells you whether (n+1) is

prime or not. Not exactly of course, but roughly.

So, if you wanted to find prime gaps of length k you would start

searching primes of about size x where x is the first solution to

floor((x+k)/log(x+k))-floor(x/log(x))=0. Does that sound

right/reasonable?

RE: Zak's sequence, I needed gaps of 194, (for which, additionally,

the previous prime was 4 less), so I just started doubling a sample x

value and testing until floor((x+194)/log(x+194))-floor(x/log(x))=0,

and ended up looking out around 13 digit primes for gaps of 194. Ran

the program over the weekend while I was out of the office, and came

back to 358 samples.

Adam