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.
%I A154598 #11 Dec 08 2016 10:45:11 %S A154598 5,19,89,271,1889,10529,75329,157951,3885569,11350529,98690561, %T A154598 65071999,652963841,6548416001,253401579521,160283668481, %U A154598 1851643543553,3450998226943,23114453401601,1194899749142527,1101483715526657,7093521158963201 %N A154598 a(n) is the smallest prime p such that p-1 and p+1 both have n prime factors (with multiplicity). %C A154598 Factors are counted with multiplicity. Sequence begins at a(2) since no prime p exists such that the adjacent numbers p-1 and p+1 have just one factor. For p = 2, p-1 has zero factors; for p >= 3, p+1 has at least two factors. %C A154598 a(24) > 2^54. - _Jon E. Schoenfield_, Feb 08 2009 %e A154598 For p = 19, p-1 = 18 = 2*3*3 and p+1 = 20 = 2*2*5 both have three factors and 19 is the smallest such prime. For p = 271, p-1 = 270 = 2*3*3*3*5 and p+1 = 272 = 2*2*2*2*17 both have five factors and 271 is the smallest prime surrounded by numbers with five factors. %e A154598 For p = 89, p-1 = 88 = 2*2*2*11 and p+1 = 90 = 2*3*3*5 both have four factors and 89 is the smallest such prime. For p = 1889, p-1 = 1888 = 2*2*2*2*2*59 and p+1 = 1890 = 2*3*3*3*5*7 both have six factors and 1889 is the smallest prime surrounded by numbers with six factors. %t A154598 a[2] = 5; a[n_] := a[n] = For[p = NextPrime[.63(*empirical*)*a[n-1]], True, p = NextPrime[p], If[PrimeOmega[p-1] == n && PrimeOmega[p+1] == n, Return[p]]]; Table[Print["a(", n, ") = ", a[n]]; a[n], {n, 2, 14}] (* _Jean-François Alcover_, Dec 08 2016 *) %o A154598 (PARI) {for(n=2, 14, p=2; while(!(bigomega(p-1)==n&&bigomega(p+1)==n), p=nextprime(p+1)); print1(p, ","))} %o A154598 (PARI) a(n)=forprime(p=2,, if(bigomega(p-1)==n && bigomega(p+1)==n, return(p))) \\ _Charles R Greathouse IV_, Apr 27 2015 %Y A154598 Cf. A001222 (number of prime divisors of n). %K A154598 nonn,nice,hard %O A154598 2,1 %A A154598 _J. M. Bergot_, Jan 12 2009 %E A154598 Edited, 2 removed, 151 replaced by 89 and a(6) - a(14) added by _Klaus Brockhaus_, Jan 12 2009 %E A154598 a(15) from _Klaus Brockhaus_, Jan 14 2009 %E A154598 a(16)-a(20) from _Jon E. Schoenfield_ and _Donovan Johnson_, Jan 21 2009 %E A154598 a(21) from _Jon E. Schoenfield_, Jan 27 2009 %E A154598 a(22) from _Jon E. Schoenfield_, Jan 28 2009 %E A154598 a(23) from _Jon E. Schoenfield_, Jan 30 2009