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

 

Logo

Please make a donation to keep the OEIS running. We are now in our 55th year. In the past year we added 12000 new sequences and reached 8000 citations (which often say "discovered thanks to the OEIS"). We need to raise money to hire someone to manage submissions, which would reduce the load on our editors and speed up editing.
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A066918 a(n) = least natural number k such that f(k) begins a maximal zigzag of length n in the prime gaps function f(x) = p(x+1)-p(x), where p(x) denotes the x-th prime. (Cf. A066485.) 2
13, 17, 9, 4, 41, 30, 293, 166, 484, 796, 134, 12209, 1646, 467, 4673, 763, 1573, 7279, 37989, 153772, 102051, 377198, 593191, 41552, 677313, 473395, 557448, 5536093, 1643927, 22986338, 1877982, 14184432, 14828672, 23278807, 45383008, 82020263 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

A zigzag of a function f(n) is a run of consecutive strict local extrema.

LINKS

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

EXAMPLE

f(11),f(12),...,f(15) are: 6, 4, 2, 4, 6. Note that a zigzag of length 1 occurs at f(13)=2. This is a maximal zigzag, since neither f(12)=4 nor f(14)=4 are local extrema of f. Also, a maximal zigzag of length 1 first occurs at f(13). Therefore a(1) = 13.

MATHEMATICA

f[n_] := Prime[n+1]-Prime[n]; e[n_] := (f[n]-f[n-1])(f[n]-f[n+1])>0; For[n=1, n<100, n++, a[n]=0]; For[k=4; l=0, True, k++, If[e[k], l++, If[a[l]===0, Print["a(", l, ")=", a[l]=k-l]]; l=0]]

CROSSREFS

Cf. A066485.

Sequence in context: A173632 A061060 A084307 * A164062 A117326 A052055

Adjacent sequences:  A066915 A066916 A066917 * A066919 A066920 A066921

KEYWORD

nonn

AUTHOR

Joseph L. Pe, Jan 23 2002

EXTENSIONS

Edited by Dean Hickerson, Jun 26 2002

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 December 13 03:41 EST 2019. Contains 329968 sequences. (Running on oeis4.)