OFFSET
1,1
COMMENTS
Let f(n) = pi(n)/n, where pi(n) is the prime-counting function (A000720). This sequence is the list of numbers n such that f(n) < f(k) for 2 <= k < n.
Because the primes generally become sparser forever, this list is infinite.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
f(10) = 0.4, which is smaller than f(2), f(3), ... , f(9), so 10 is in the list.
MATHEMATICA
s={}; rm=1; Do[r = PrimePi[n]/n; If[r<rm, rm=r; AppendTo[s, n]], {n, 2, 1000}]; s (* Amiram Eldar, Mar 19 2019 *)
DeleteDuplicates[Table[{n, PrimePi[n]/n}, {n, 2, 250}], LessEqual[#1[[2]], #2[[2]]]&][[;; , 1]] (* Harvey P. Dale, May 30 2023 *)
PROG
(Haskell)
-- Very poor Haskell code, but let it stand until someone contributes the
-- elegant three-liner that must exist. Its only merit is that it was actually
-- used to produce the data given.
isPrime :: Int -> Bool
isPrime = isPrime1 2
isPrime1 :: Int -> Int -> Bool
isPrime1 d n = n /= 1 && (d^2 > n || mod n d /= 0 && isPrime1 (d+1) n)
count :: (a -> Bool) -> [a] -> Int
count f [] = 0
count f (x:xs) = (if f x then 1 else 0) + count f xs
pdf :: Int -> Double
pdf n = fromIntegral (count isPrime [1..n]) / fromIntegral n
isRecord :: Int -> Bool
isRecord n = (n == 2) || (pdf n) < (minimum (map pdf [2..(n-1)]))
records :: [Int]
records = filter isRecord [2..100]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Allan C. Wechsler, Mar 18 2019
EXTENSIONS
More terms from Amiram Eldar, Mar 19 2019
STATUS
approved