Compute the weight of a sequence of primes of the form k · bn + a
Let k ≥ 1, b ≥ 2 and a ≠ 0 be integers. We search for an estimate of the number of primes in the sequence of numbers of the form P(n) = k · bn + a for 1 ≤ n ≤ N. It is expected to be C(k, b, a) · Sum1 ≤ n ≤ N 1 / log P(n).
weight computes an approximation of the constant C(k, b, a).
It is a PARI/GP program. It can be executed in Run PARI/GP in your browser if N0 and P0 are not too large (for instance, N0 = P0 = 400,000).
See Yves Gallot, On the number of primes in a sequence for more details and the definition of N0 and P0.