A078667 Integers that occur more than once as the difference of the squares of two consecutive primes.
72, 120, 168, 312, 408, 552, 600, 768, 792, 912, 1032, 1848, 2472, 3048, 3192, 3288, 3528, 3720, 4008, 4920, 5160, 5208, 5808, 5928, 6072, 6480, 6792, 6840, 6888, 7080, 7152, 7248, 7512, 7728, 7800, 8520, 8760, 9072, 11400, 11880, 11928, 12792, 13200, 13320
Offset: 1
Keywords
Examples
120 = 31^2 - 29^2 = 17^2 - 13^2.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
N:= 20000: # for terms <= N V:= Vector(N): p:= 3: while 4*(p-1) <= N do q:= p; p:= nextprime(p); v:= p^2 - q^2; if v > N then next fi; V[v]:= V[v]+1 od: select(v -> V[v] > 1, 2*[$1..N/2]); # Robert Israel, Aug 22 2025
-
Mathematica
Sort@ DeleteDuplicates@ Flatten@ Select[Gather[NextPrime[#]^2 - #^2 & /@ Prime@ Range@ 1200], Length@ # > 1 &] (* Michael De Vlieger, Mar 18 2015 *) Select[Tally[Differences[Prime[Range[1000]]^2]],#[[2]]>1&][[;;,1]]//Sort (* Harvey P. Dale, Nov 16 2023 *)
-
PARI
pv(v)=vecsort(vecextract(v,concat("1..",vc-1))) op=2; v=vector(5000); vc=1; forprime (p=3,5000,v[vc]=p^2-op^2; vc++; op=p) v=pv(v) for (i=2,length(v), if (v[i]==v[i-1],print1(v[i]",")))
Extensions
Duplicate terms removed, as suggested by Richard R. Forberg, by Jon E. Schoenfield, Mar 15 2015
Comments