login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A248704 Smallest prime such that the n preceding prime gaps are strictly decreasing and the n subsequent prime gaps strictly increasing. 4
3, 19, 1429, 25243, 340577, 1107791 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Table of n, a(n) for n=1..6.

Abhiram R Devesh, Python code for generating strict valley primes

EXAMPLE

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.

MAPLE

A248704 := proc(n)

    local glist, p, wrks, s ;

    if n = 0 then

        return ;

    else

        s := n+1 ;

        p := ithprime(s) ;

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

        while true do

            wrks := true;

            for i from 1 to n-1 do

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

                    wrks := false;

                    break;

                end if;

            end do:

            if wrks then

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

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

                        wrks := false;

                        break;

                    end if;

                end do:

            end if;

            if wrks then

                return p;

            end if;

            p := nextprime(p) ;

            s := s+1 ;

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

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

        end do:

    end if;

end proc: # R. J. Mathar, Dec 04 2014

CROSSREFS

Cf. A248701, A248702, A248703.

Sequence in context: A114301 A258669 A192340 * A098796 A120563 A182344

Adjacent sequences:  A248701 A248702 A248703 * A248705 A248706 A248707

KEYWORD

nonn,more

AUTHOR

Abhiram R Devesh, Oct 12 2014

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 16 04:26 EDT 2019. Contains 325064 sequences. (Running on oeis4.)