OFFSET
1,1
COMMENTS
If p(k) is in the sequence, then the four consecutive primes p(k), p(k+1), p(k+2), p(k+3) possess a property of quadruplet of consecutive squares: n^2 + (n+3)^2 = (n+1)^2 + (n+2)^2 + 4.
Cf. A022885, where such quadruplets possess a linear property: n + (n+3) = (n+1) + (n+2).
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
EXAMPLE
17 is in the sequence since 17, 19, 23, and 29 are four consecutive primes and it holds 17 + 29 = 19 + 23 + 4.
MATHEMATICA
f[{a_, b_, c_, d_}]:= a-b-c+d; First /@ Select[Partition[Prime@ Range@ 500, 4, 1], f@# == 4 &] (* Giovanni Resta, Jan 16 2014 *)
Transpose[Select[Partition[Prime[Range[5000]], 4, 1], First[#] + Last[#]==#[[2]] + #[[3]] + 4&]][[1]] (* Vincenzo Librandi, Feb 02 2014 *)
PROG
(PARI) isok(p) = { my(k = primepi(p)); (p == prime(k)) && ((prime(k) + prime(k+3)) == (prime(k+1) + prime(k+2) + 4)); } \\ Michel Marcus, Jan 15 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Jan 15 2014
EXTENSIONS
More terms from Michel Marcus, Jan 15 2014
STATUS
approved