login
Search: a051729 -id:a051729
     Sort: relevance | references | number | modified | created      Format: long | short | data
Lonely (or isolated) primes: increasing distance to nearest prime.
+10
25
2, 5, 23, 53, 211, 1847, 2179, 3967, 16033, 24281, 38501, 58831, 203713, 206699, 413353, 1272749, 2198981, 5102953, 10938023, 12623189, 72546283, 142414669, 162821917, 163710121, 325737821, 1131241763, 1791752797, 3173306951, 4841337887, 6021542119, 6807940367, 7174208683, 8835528511, 11179888193, 15318488291, 26329105043, 31587561361, 45241670743
OFFSET
1,1
COMMENTS
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
REFERENCES
Paul Erdős and Janos Suranyi, Topics in the theory of numbers, Springer, 2003.
LINKS
Dmitry Petukhov, Table of n, a(n) for n = 1..56 (first 40 terms from Ken Takusagawa, terms 41..52 from Giovanni Resta)
EXAMPLE
The nearest prime to 23 is 4 units away, larger than any previous prime, so 23 is in the sequence.
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
MATHEMATICA
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}]
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 *)
CROSSREFS
The distances are in A023187.
KEYWORD
nonn,nice
EXTENSIONS
More terms from Jud McCranie, Jun 16 2000
More terms from T. D. Noe, Jul 21 2006
STATUS
approved
Closest prime to n-th prime p that is different from p (break ties by taking the smaller prime).
+10
5
3, 2, 3, 5, 13, 11, 19, 17, 19, 31, 29, 41, 43, 41, 43, 47, 61, 59, 71, 73, 71, 83, 79, 83, 101, 103, 101, 109, 107, 109, 131, 127, 139, 137, 151, 149, 151, 167, 163, 167, 181, 179, 193, 191, 199, 197, 199, 227, 229, 227, 229, 241, 239, 257, 251, 257, 271, 269
OFFSET
1,1
COMMENTS
A227878 gives the terms occurring twice. - Reinhard Zumkeller, Oct 25 2013
EXAMPLE
Closest primes to 2,3,5,7,11 are 3,2,3,5,13.
MATHEMATICA
a[n_] := (p = Prime[n]; np = NextPrime[p]; pp = NextPrime[p, -1]; If[np-p < p-pp, np, pp]); Table[a[n], {n, 1, 58}] (* Jean-François Alcover, Oct 20 2011 *)
cp[{a_, b_, c_}]:=If[c-b<b-a, c, a]; Join[{3}, cp/@Partition[Prime[Range[ 60]], 3, 1]] (* Harvey P. Dale, Oct 08 2012 *)
PROG
(Haskell)
a051701 n = a051701_list !! (n-1)
a051701_list = f 2 $ 1 : a000040_list where
f d (q:ps@(p:p':_)) = (if d <= d' then q else p') : f d' ps
where d' = p' - p
-- Reinhard Zumkeller, Oct 25 2013
(Python)
from sympy import nextprime
def aupton(terms):
prv, cur, nxt, alst = 0, 2, 3, []
while len(alst) < terms:
alst.append(prv if 2*cur - prv <= nxt else nxt)
prv, cur, nxt = cur, nxt, nextprime(nxt)
return alst
print(aupton(58)) # Michael S. Branicky, Jun 04 2021
CROSSREFS
KEYWORD
nonn,easy,nice
EXTENSIONS
More terms from James A. Sellers
STATUS
approved
a(n) = phi(n)*tau(n) - 2n = A000010(n)*A000005(n) - 2*n.
+10
2
-1, -2, -2, -2, -2, -4, -2, 0, 0, -4, -2, 0, -2, -4, 2, 8, -2, 0, -2, 8, 6, -4, -2, 16, 10, -4, 18, 16, -2, 4, -2, 32, 14, -4, 26, 36, -2, -4, 18, 48, -2, 12, -2, 32, 54, -4, -2, 64, 28, 20, 26, 40, -2, 36, 50, 80, 30, -4, -2, 72, -2, -4, 90, 96, 62, 28, -2, 56, 38, 52, -2, 144, -2, -4, 90, 64, 86, 36, -2, 160, 108, -4, -2, 120, 86, -4
OFFSET
1,2
COMMENTS
It can be shown that phi(n)*tau(n) >= n, which means that quotient = n/tau(n) <= phi(n); note: a(n)+5 is positive.
The value is always positive except when a(n) = 0 for {8,9,12}; or a(n) = -2 for primes together with 4 (i.e., for A046022 but without 1); or a(n) = -4 for A001747 (without 2 and 4); or a(n) = -1 for n = 1.
LINKS
FORMULA
a(n) = A062355(n) - 2*n. - Amiram Eldar, Jul 10 2024
MATHEMATICA
Table[EulerPhi[n]DivisorSigma[0, n]-2n, {n, 90}] (* Harvey P. Dale, Feb 03 2021 *)
PROG
(PARI) a(n)={eulerphi(n)*numdiv(n) - 2*n} \\ Harry J. Smith, Aug 11 2009
KEYWORD
sign
AUTHOR
Labos Elemer, Jul 20 2001
EXTENSIONS
Offset changed from 0 to 1 by Harry J. Smith, Aug 11 2009
STATUS
approved

Search completed in 0.006 seconds