login
a(n) can be expressed as the difference of the squares of consecutive primes in just three distinct ways.
5

%I #15 Aug 15 2018 22:25:47

%S 1848,6888,14280,16008,19152,36120,112728,116832,129480,139080,176520,

%T 190632,190968,199752,216840,236208,252120,274848,303960,314160,

%U 340368,363720,435792,458280,503160,513240,686160,688680,698880,712680,721560

%N a(n) can be expressed as the difference of the squares of consecutive primes in just three distinct ways.

%H Giovanni Resta, <a href="/A090783/b090783.txt">Table of n, a(n) for n = 1..10000</a> (first 3091 terms from Robert Israel)

%e 1848 = 463^2 - 461^2 = 233^2 - 229^2 = 157^2 - 151^2.

%p N:= 10^6: # to get all terms <= N

%p V:= Vector(N/4):

%p p:= 3:

%p while p < N/2 do

%p q:= p;

%p p:= nextprime(p);

%p r:= (p^2-q^2)/4;

%p if r <= N/4 then

%p V[r]:= V[r]+1

%p fi

%p od:

%p map(`*`,select(t -> V[t]=3, [$1..N/4]),4); # _Robert Israel_, Aug 13 2018

%o (PARI) is(n) = my(i=0, v=[]); forprime(p=5, n, v=[precprime(p-1), p]; if(v[2]^2-v[1]^2==n, i++)); i==3 \\ _Felix Fröhlich_, Aug 13 2018

%Y Cf. A078667, A090784, A090785, A091878.

%K nonn

%O 1,1

%A _Ray G. Opao_, Feb 08 2004

%E More terms from _Ray Chandler_, Feb 11 2004