OFFSET
1,1
COMMENTS
See Tutaj (2014) for the precise definition.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..500
Nathan McNew, The Most Frequent Values of the Largest Prime Divisor Function, Exper. Math., 2017, Vol. 26, No. 2, 210-224; also arXiv:1504.05985 [math.NT], 2015.
Carl Pomerance, The Prime Number Graph, Mathematics of Computations, Volume 33, 145, January 1979, pages 399-408.
Edward Tutaj, Prime numbers with a certain extremal type property, arXiv:1408.3609 [math.NT], 2014.
MAPLE
plist := [2, 3] ;
nlist := [1, 2] ;
p := 5 ;
for n from 3 to 100000 do # experimental upper limit!
plist := [op(plist), p] ;
nlist := [op(nlist), n] ;
doflat := true ;
while doflat do
doflat := false ;
for nrew from nops(nlist)-1 to 2 by -1 do
slopold := (nlist[nrew]-nlist[nrew-1])/(plist[nrew]-plist[nrew-1]) ;
slop := (nlist[nrew+1]-nlist[nrew])/(plist[nrew+1]-plist[nrew]) ;
if slop >= slopold then
plist := subsop(nrew=NULL, plist) ;
nlist := subsop(nrew=NULL, nlist) ;
doflat := true ;
end if;
end do:
end do:
print(plist) ;
p := nextprime(p) ;
end do: # R. J. Mathar, Jul 28 2017
MATHEMATICA
terms = 50; nmax0 = 25000; dnmax = 1000; Clear[f];
f[nmax_] := f[nmax] = Module[{}, plist = {2, 3}; nlist = {1, 2}; p = 5;
For[n = 3, n <= nmax, n++,
plist = Append[plist, p];
nlist = Append[nlist, n]; doflat = True;
While[doflat, doflat = False;
For[nrew = Length[nlist]-1, nrew >= 2, nrew--, slopold = (nlist[[nrew]] - nlist[[nrew-1]])/(plist[[nrew]] - plist[[nrew-1]]); slop = (nlist[[nrew+1]] - nlist[[nrew]])/(plist[[nrew+1]] - plist[[nrew]]); If [slop >= slopold, plist [[nrew]] = Nothing nlist[[nrew]] = Nothing; doflat = True]]
]; p = NextPrime[p]
]; PadRight[plist, terms]
];
f[nmax = nmax0]; f[nmax = nmax + dnmax];
While[Print[nmax]; f[nmax][[1 ;; terms]] != f[nmax - dnmax][[1 ;; terms]], nmax = nmax + dnmax];
f[nmax] (* Jean-François Alcover, Nov 01 2018, from R. J. Mathar's Maple code *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus and N. J. A. Sloane, Aug 18 2014
EXTENSIONS
a(14) corrected by Edward Tutaj and Charles R Greathouse IV, Nov 27 2014
Primes beyond 33647 from R. J. Mathar, Jul 28 2017
STATUS
approved