2
$\begingroup$
ListPlot[Table[RandomReal[n, Prime[1000]]/n*log (n), {n, 2, 1000}]]

this is all i can do.

$\endgroup$
3
  • 4
    $\begingroup$ You're close. Use this ListPlot[Table[Prime[n]/(n*Log[n]), {n, 2, 1000}]]. $\endgroup$
    – Ben Izd
    Commented Dec 19, 2022 at 17:36
  • 1
    $\begingroup$ @BenIzd ListPlot by default plots its data starting from the point 1 on the abscissa. Try ListPlot[{2, 3, 4}] as an example. To correct your suggestion: either ListPlot[Table[Prime[n]/(n*Log[n]), {n, 2, 1000}], DataRange -> {2, 1000}] or ListPlot[Table[{n, Prime[n]/(n*Log[n])}, {n, 2, 1000}]] $\endgroup$
    – Roman
    Commented Dec 23, 2022 at 7:59
  • $\begingroup$ @Roman You're right. It's a subtle tip I missed. Thank you for pointing that out. $\endgroup$
    – Ben Izd
    Commented Dec 23, 2022 at 16:51

1 Answer 1

8
$\begingroup$
DiscretePlot[Prime[n]/(n Log[n]), {n, 1000}]

enter image description here

$\endgroup$
1
  • 3
    $\begingroup$ Nice use of DiscretePlot[] $\endgroup$ Commented Dec 19, 2022 at 18:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.