A155800 a(n) = smallest prime p such that p-1 and p+1 together have n prime divisors, or a(n) = 0 if no such prime exists.
2, 0, 3, 5, 7, 19, 17, 31, 97, 191, 127, 449, 769, 3329, 6143, 7937, 12799, 51199, 8191, 165887, 65537, 131071, 1179649, 2654209, 7995391, 524287, 10616831, 12910591, 167772161, 113246209, 169869311, 155189249, 1887436799, 3221225473
Offset: 1
Keywords
Examples
For p=2, the adjacent numbers 1 and 3 together have one prime divisor, hence a(1) = 2. For p=3, the adjacent numbers 2 and 4 together have three prime divisors, hence a(3) = 3. For primes greater than 3, the adjacent numbers are composite and therefore together have at least four prime divisors, so no prime exists whose neighbors together have two prime divisors. Hence a(2) = 0. For p = 19, p-1 = 18 = 2*3*3 and p+1 = 20 = 2*2*5 together have six prime divisors. All smaller primes are surrounded by numbers which together have fewer or more than six (for 17 there are seven) prime divisors, hence a(6) = 19.
Links
- Donovan Johnson and Giovanni Resta, Table of n, a(n) for n = 1..46 (terms < 10^13, first 40 terms from Donovan Johnson)
Crossrefs
Programs
-
Mathematica
Join[{2,0},With[{m=SortBy[{PrimeOmega[#-1]+PrimeOmega[#+1],#}&/@Prime[ Range[200000]],First]},Transpose[Flatten[Table[Select[m,#[[1]]==n&,1],{n,3,24}],1]][[2]]]] (* Harvey P. Dale, Sep 24 2013 *)
-
PARI
N=10^7; default(primelimit, N); M=26; /* M must be determined empirically for each N. Program-generated zeros other than a(2) appearing as terms when N and M are increased must be regarded as provisional */ for(m=1,M,t=0;forprime(p=1,N,if(bigomega(p-1)+bigomega(p+1)==m,t=1;print1(p", ");break));if(t==0,print1("0, "))) \\ Chris Boyd, Mar 24 2014
Extensions
Edited, 1151 replaced by 769, 3457 replaced by 3329, extended beyond a(14) by Klaus Brockhaus, Jan 28 2009
a(29)-a(32) from Klaus Brockhaus, Jan 30 2009
a(33)-a(34) from Donovan Johnson, Aug 03 2009
Comments