login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A306998 List of low point records for pi(n)/n. 1
2, 9, 10, 16, 22, 25, 26, 27, 28, 35, 36, 40, 51, 52, 56, 57, 58, 66, 70, 78, 82, 86, 87, 88, 92, 93, 94, 95, 96, 121, 122, 123, 124, 125, 126, 135, 136, 145, 146, 147, 148, 162, 171, 172, 177, 178, 187, 188, 189, 190, 209, 210, 215, 216, 217, 218, 219, 220 (list; graph; refs; listen; history; text; internal format)
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
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
Cf. A000720.
Sequence in context: A078180 A058890 A369205 * A047468 A032929 A226832
KEYWORD
nonn,easy
AUTHOR
Allan C. Wechsler, Mar 18 2019
EXTENSIONS
More terms from Amiram Eldar, Mar 19 2019
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 15:20 EDT 2024. Contains 371916 sequences. (Running on oeis4.)