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.

Showing 1-3 of 3 results.

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.)

Original entry on oeis.org

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
Offset: 1

Views

Author

Joseph L. Pe, Jan 23 2002

Keywords

Comments

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

Examples

			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.
		

Crossrefs

Cf. A066485.

Programs

  • 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]]

Extensions

Edited by Dean Hickerson, Jun 26 2002

A066923 Let f(x) = phi(x) + sigma(x); a(n) = least k such that at k begins a maximal run of length n of consecutive strict local extrema of f, or 0 if no such k exists.

Original entry on oeis.org

118, 12, 443, 190, 40, 16, 5847, 180, 108, 48, 1427, 670510, 2388, 228, 407, 1577, 424, 2500, 2500383, 22848, 4853, 1240, 323975, 0, 10668, 588, 10727, 45677, 18713, 1903672, 0, 0, 119028, 18880, 391659, 0, 883428, 480036, 1635467, 896933, 50380
Offset: 1

Views

Author

Joseph L. Pe, Jan 23 2002

Keywords

Comments

A084622 gives the strict local extrema for f. A run of consecutive strict local extrema of a function is sometimes called a zigzag, cf. A066485. A066918 is an analog of the present sequence for the prime gaps function.
The zero terms a(24), a(31), a(32), a(36) are preliminary since only values of f(n) for n up to 6000000 were taken into account. Further nonzero terms are a(45) = 1413696, a(46) = 185195, a(49) = 4961856, a(50) = 2370036.

Examples

			f(10) = 22, f(11) = 22, f(12) = 32, f(13) = 26, f(14) = 30, f(15) = 32. A run of length 2 begins at f(12) = 32 because f(12) = 32 is a local maximum and f(13) = 26 is local minimum.
This is a maximal run, since neither f(11) = 22 nor f(14) = 30 are local extrema of f. Also, a maximal run of length 2 first occurs at f(12) = 32. Therefore a(2) = 12.
		

Crossrefs

Programs

  • Mathematica
    f[ n_ ] := EulerPhi[ n ] + DivisorSigma[ 1, n ]; e[ n_ ] := (f[ n - 1 ] < f[ n ] && f[ n + 1 ] < f[ n ]) || (f[ n - 1 ] > f[ n ] && f[ n + 1 ] > f[ n ]); z[ n_, k_ ] := Module[ {r = True, i = 0}, While[ i <= k && r == True, If[ e[ n + i ], r = False ]; i++ ]; r ]; z2[ n_, k_ ] := z[ n, k ] && ! e[ n + k + 1 ] && ! e[ n - 1 ]; k[ n_ ] := Module[ {i = 2, r = False}, While[ r == False && i < 10^6, If[ z2[ i, n ], r = True; Print[ i ] ]; i++ ]; If[ r == False, Print[ "0" ] ] ]; Table[ {i, k[ i ]}, {i, 0, 17} ]
  • PARI
    f(x)=eulerphi(x)+sigma(x)
    {locext(n)=local(a,b,c); a=if(n<2,0,f(n-1)); b=f(n); c=f(n+1); if(ac,1,if(a>b&&b
    				

Extensions

Edited, corrected (a(12)) and extended (a(19) ff.) by Klaus Brockhaus, Jun 01 2003

A084622 Numbers n such that f(n) is a strict local extremum for the function f(x) = phi(x) + sigma(x); i.e., either f(n) > f(n-1) and f(n) > f(n+1) or f(n) < f(n-1) and f(n) < f(n+1).

Original entry on oeis.org

12, 13, 16, 17, 18, 19, 20, 21, 24, 25, 28, 29, 30, 31, 32, 33, 36, 37, 40, 41, 42, 43, 44, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 76, 77, 78, 79, 80, 84, 85, 88, 89, 90, 91, 92, 93, 96, 97, 100, 101, 102, 103, 104, 108, 109
Offset: 1

Views

Author

Klaus Brockhaus, Jun 01 2003

Keywords

Comments

For runs of consecutive strict local extrema (alternating minima/maxima, zigzags) of f, cf. A066923.
A066485 is an analog of the present sequence for the prime gaps function.

Examples

			16 is a term since f(16) is a local maximum: f(15) = 32, f(16) = 39, f(17) = 34.
		

Crossrefs

Programs

  • PARI
    f(x)=eulerphi(x)+sigma(x)
    {locext(n)=local(a,b,c); a=if(n<2,0,f(n-1)); b=f(n); c=f(n+1); if(ac,1,if(a>b&&b
    				
Showing 1-3 of 3 results.