login
Differences between the numbers n such that n^2 + 2 is prime.
2

%I #10 Aug 18 2015 15:32:03

%S 1,2,6,6,6,12,6,6,12,24,18,6,6,6,6,24,24,48,6,12,6,6,6,18,24,6,6,12,

%T 24,6,12,6,6,12,30,6,6,12,6,6,24,24,12,36,6,6,12,30,6,42,24,6,18,12,

%U 42,24,30,12,18,30,18,12,6,6,24,24,12,12,30,24,36,42,18

%N Differences between the numbers n such that n^2 + 2 is prime.

%C Sequence A067201 has the values of n. This sequence is the first differences of A067201.

%C a(n) is divisible by 6 for n>2.

%H Michel Lagneau, <a href="/A260930/b260930.txt">Table of n, a(n) for n = 1..10000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Near-SquarePrime.html">Near-Square Prime</a>

%e a(6)=12 because A067201(7) - A067201(6) = 33 - 21 = 12.

%p i0:=0:

%p for k from 1 to 1500 do:

%p p:=k^2+2:

%p if isprime(p) then printf(`%d, `,k-i0):i0:=k:

%p else

%p fi:

%p od:

%t Differences[Select[Range[1500], PrimeQ[2 + #^2] &, 100]]

%o (PARI) first(m)=my(u=vector(m+1),v=vector(m),r=0);for(i=1,m+1,while(!isprime(r^2 + 2),r++);u[i]=r;r++);for(i=1,m,v[i]=u[i+1]-u[i]);v; \\ _Anders Hellström_, Aug 14 2015

%Y Cf. A056899 (primes of the form n^2+2), A067201 (values of n).

%K nonn

%O 1,2

%A _Michel Lagneau_, Aug 04 2015