Consecutive primes with ascending or descending differences: Difference between revisions

m
Line 636:
 
=={{header|Pari/GP}}==
Code is pretty reasonable, runs in ~70 ms at 1,000,000. Running under PARI (withstarting from gp2c translation) could take advantage of the diff structure of the prime table directly for small cases and avoid substantial overhead, gaining at least a factor of 2 in performance.
<lang parigp>showPrecPrimes(p, n)=
{