OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 449 is a term because the four consecutive primes starting with 449 are 449, 457, 461, 463, and (463-461)*(457-449) = (461-457)^2 = 16.
MAPLE
P:= select(isprime, [seq(i, i=3..20000, 2)]):
R:= select(t -> (P[t+3]-P[t+2])*(P[t+1]-P[t]) = (P[t+2]-P[t+1])^2, [$1..nops(P)-3]):
P[R];
MATHEMATICA
Select[Partition[Prime[Range[2000]], 4, 1], (#[[4]] - #[[3]])*(#[[2]] - #[[1]]) == (#[[3]] - #[[2]])^2 &][[;; , 1]] (* Amiram Eldar, May 23 2022 *)
PROG
(Python)
from sympy import nextprime
from itertools import islice
def agen(): # generator of terms
p1, p2, p3, p4 = 2, 3, 5, 7
while True:
if (p4-p3)*(p2-p1) == (p3-p2)**2: yield p1
p1, p2, p3, p4 = p2, p3, p4, nextprime(p4)
print(list(islice(agen(), 47))) # Michael S. Branicky, May 22 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, May 22 2022
STATUS
approved