login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Smallest prime such that the n preceding prime gaps are strictly decreasing and the n subsequent prime gaps strictly increasing.
4

%I #15 Dec 04 2014 15:11:58

%S 3,19,1429,25243,340577,1107791

%N Smallest prime such that the n preceding prime gaps are strictly decreasing and the n subsequent prime gaps strictly increasing.

%H Abhiram R Devesh, <a href="/A248704/a248704.py.txt">Python code for generating strict valley primes</a>

%e a(3)=1429 is in the middle of the sequence of successive primes [1409, 1423, 1427, 1429, 1433, 1439 , 1447] which have prime gaps [14, 4, 2, 4, 6, 8], and 14>4>2 is strictly decreasing and 4<6<8 is strictly increasing.

%p A248704 := proc(n)

%p local glist,p,wrks,s ;

%p if n = 0 then

%p return ;

%p else

%p s := n+1 ;

%p p := ithprime(s) ;

%p glist := [seq(ithprime(i+1)-ithprime(i),i=1..2*n)] ;

%p while true do

%p wrks := true;

%p for i from 1 to n-1 do

%p if glist[i] <= glist[i+1] then

%p wrks := false;

%p break;

%p end if;

%p end do:

%p if wrks then

%p for i from n+1 to 2*n-1 do

%p if glist[i] >= glist[i+1] then

%p wrks := false;

%p break;

%p end if;

%p end do:

%p end if;

%p if wrks then

%p return p;

%p end if;

%p p := nextprime(p) ;

%p s := s+1 ;

%p glist := subsop(1=NULL,glist) ;

%p glist := [op(glist),ithprime(s+n)-ithprime(s+n-1)] ;

%p end do:

%p end if;

%p end proc: # _R. J. Mathar_, Dec 04 2014

%Y Cf. A248701, A248702, A248703.

%K nonn,more

%O 1,1

%A _Abhiram R Devesh_, Oct 12 2014