cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A262668 Numbers n such that n-19, n-1, n+1 and n+19 are consecutive primes.

This page as a plain text file.
%I A262668 #18 May 22 2025 10:21:43
%S A262668 20982,28182,51768,57222,76422,87720,90678,104850,108108,110730,
%T A262668 141180,199602,227112,248118,264600,268842,304392,304458,320082,
%U A262668 322920,330018,382728,401670,414432,429972,450258,467082,489408,520548,535608,540120
%N A262668 Numbers n such that n-19, n-1, n+1 and n+19 are consecutive primes.
%C A262668 This sequence is a subsequence of A014574 (average of twin prime pairs) and A256753.
%C A262668 The terms ending in 0 are divisible by 30 (cf. A249674).
%C A262668 The terms ending in 2 and 8 are congruent to 12 mod 30 and 18 mod 30 respectively.
%H A262668 Karl V. Keller, Jr., <a href="/A262668/b262668.txt">Table of n, a(n) for n = 1..10000</a>
%H A262668 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/TwinPrimes.html">Twin Primes</a>
%e A262668 20982 is the average of the four consecutive primes 20963, 20981, 20983, 21001.
%e A262668 28182 is the average of the four consecutive primes 28163, 28181, 28183, 28201.
%t A262668 Select[Range[6, 600000, 6], And[AllTrue[{# - 1, # + 1}, PrimeQ], NextPrime[# - 1, -1] == # - 19, NextPrime[# + 1] == # + 19] &] (* _Michael De Vlieger_, Sep 27 2015, Version 10 *)
%t A262668 Select[Prime@Range@60000, NextPrime[#, {1, 2, 3}] == {18, 20, 38} + # &] + 19 (* _Vincenzo Librandi_, Oct 10 2015 *)
%t A262668 Mean/@Select[Partition[Prime[Range[50000]],4,1],Differences[#]=={18,2,18}&] (* _Harvey P. Dale_, Jan 16 2019 *)
%o A262668 (Python)
%o A262668 from sympy import isprime,prevprime,nextprime
%o A262668 for i in range(0,1000001,6):
%o A262668   if isprime(i-1) and isprime(i+1):
%o A262668     if prevprime(i-1) == i-19 and nextprime(i+1) == i+19 : print(i,end=', ')
%Y A262668 Cf. A014574, A077800 (twin primes), A249674, A256753.
%K A262668 nonn
%O A262668 1,1
%A A262668 _Karl V. Keller, Jr._, Sep 26 2015