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.

A023186 Lonely (or isolated) primes: increasing distance to nearest prime.

This page as a plain text file.
%I A023186 #48 Feb 18 2024 02:02:36
%S A023186 2,5,23,53,211,1847,2179,3967,16033,24281,38501,58831,203713,206699,
%T A023186 413353,1272749,2198981,5102953,10938023,12623189,72546283,142414669,
%U A023186 162821917,163710121,325737821,1131241763,1791752797,3173306951,4841337887,6021542119,6807940367,7174208683,8835528511,11179888193,15318488291,26329105043,31587561361,45241670743
%N A023186 Lonely (or isolated) primes: increasing distance to nearest prime.
%C A023186 Erdős and Suranyi call these reclusive primes and prove that there are an infinite number of them. They define these primes to be between two primes. Hence their first term would be 3 instead of 2. Record values in A120937. - _T. D. Noe_, Jul 21 2006
%D A023186 Paul Erdős and Janos Suranyi, Topics in the theory of numbers, Springer, 2003.
%H A023186 Dmitry Petukhov, <a href="/A023186/b023186.txt">Table of n, a(n) for n = 1..56</a> (first 40 terms from Ken Takusagawa, terms 41..52 from Giovanni Resta)
%e A023186 The nearest prime to 23 is 4 units away, larger than any previous prime, so 23 is in the sequence.
%e A023186 The prime a(4) = A120937(3) = 53 is at distance 2*3 = 6 from its neighbors {47, 59}. The prime a(5) = A120937(4) = A120937(5) = A120937(6) = 211 is at distance 2*6 = 12 from its neighbors {199, 223}. Sequence A120937 requires the terms to have 2 neighbors, therefore its first term is 3 and not 2. - _M. F. Hasler_, Dec 28 2015
%t A023186 p = 0; q = 2; i = 0; Do[r = NextPrime[q]; m = Min[r - q, q - p]; If[m > i, Print[q]; i = m]; p = q; q = r, {n, 1, 152382000}]
%t A023186 Join[{2},DeleteDuplicates[{#[[2]],Min[Differences[#]]}&/@Partition[Prime[ Range[ 2,10^6]],3,1],GreaterEqual[ #1[[2]],#2[[2]]]&][[;;,1]]] (* The program generates the first 20 terms of the sequence. *) (* _Harvey P. Dale_, Aug 31 2023 *)
%Y A023186 Related sequences: A023186, A023187, A023188, A046929, A046930, A046931, A051650, A051652, A051697-A051702, A051728, A051729, A051730, A102723.
%Y A023186 The distances are in A023187.
%K A023186 nonn,nice
%O A023186 1,1
%A A023186 _David W. Wilson_
%E A023186 More terms from _Jud McCranie_, Jun 16 2000
%E A023186 More terms from _T. D. Noe_, Jul 21 2006