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.

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.

This page as a plain text file.
%I A155800 #28 Mar 30 2014 04:28:43
%S A155800 2,0,3,5,7,19,17,31,97,191,127,449,769,3329,6143,7937,12799,51199,
%T A155800 8191,165887,65537,131071,1179649,2654209,7995391,524287,10616831,
%U A155800 12910591,167772161,113246209,169869311,155189249,1887436799,3221225473
%N 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.
%C A155800 Prime divisors are counted with multiplicity.
%H A155800 Donovan Johnson and Giovanni Resta, <a href="/A155800/b155800.txt">Table of n, a(n) for n = 1..46</a> (terms < 10^13, first 40 terms from Donovan Johnson)
%e A155800 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.
%e A155800 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.
%t A155800 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 *)
%o A155800 (PARI) N=10^7; default(primelimit, N); M=26;
%o A155800 /* 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 */
%o A155800 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
%Y A155800 Cf. A001222 (number of prime divisors of n), A154598, A155850, A154704.
%Y A155800 Cf. comments in A239669.
%K A155800 nonn
%O A155800 1,1
%A A155800 _J. M. Bergot_, Jan 27 2009
%E A155800 Edited, 1151 replaced by 769, 3457 replaced by 3329, extended beyond a(14) by _Klaus Brockhaus_, Jan 28 2009
%E A155800 a(29)-a(32) from _Klaus Brockhaus_, Jan 30 2009
%E A155800 a(33)-a(34) from _Donovan Johnson_, Aug 03 2009