{"title":"新的快速方法来计算质数小于给定值的数量","authors":"G. R. P. Teruel","doi":"10.37863/umzh.v74i9.6193","DOIUrl":null,"url":null,"abstract":"<jats:p>\n\n\nUDC 519.688\n\n\n\nThe paper describes new fast algorithms for evaluating <mml:math>\n<mml:mrow>\n\t<mml:mi>π</mml:mi>\n\t<mml:mrow>\n\t\t<mml:mo form=\"prefix\">(</mml:mo>\n\t\t<mml:mi>x</mml:mi>\n\t\t<mml:mo form=\"postfix\">)</mml:mo>\n\t</mml:mrow>\n</mml:mrow>\n</mml:math> inspired by the harmonic and geometric mean integrals that can be used on any pocket calculator. In particular, the formula <mml:math>\n<mml:mrow>\n\t<mml:mi>h</mml:mi>\n\t<mml:mrow>\n\t\t<mml:mo form=\"prefix\">(</mml:mo>\n\t\t<mml:mi>x</mml:mi>\n\t\t<mml:mo form=\"postfix\">)</mml:mo>\n\t</mml:mrow>\n</mml:mrow>\n</mml:math> based on the harmonic mean is within <mml:math>\n<mml:mrow>\n\t<mml:mo>≈</mml:mo>\n\t<mml:mn>15</mml:mn>\n</mml:mrow>\n</mml:math> of the actual value for <mml:math>\n<mml:mrow>\n\t<mml:mn>3</mml:mn>\n\t<mml:mo>≤</mml:mo>\n\t<mml:mi>x</mml:mi>\n\t<mml:mo>≤</mml:mo>\n\t<mml:mn>10000.</mml:mn>\n</mml:mrow>\n</mml:math> The approximation verifies the inequality, <mml:math>\n<mml:mrow>\n\t<mml:mi>h</mml:mi>\n\t<mml:mrow>\n\t\t<mml:mo form=\"prefix\">(</mml:mo>\n\t\t<mml:mi>x</mml:mi>\n\t\t<mml:mo form=\"postfix\">)</mml:mo>\n\t</mml:mrow>\n\t<mml:mo>≤</mml:mo>\n\t<mml:mstyle mathvariant=\"normal\">\n\t\t<mml:mi>L</mml:mi>\n\t\t<mml:mi>i</mml:mi>\n\t</mml:mstyle>\n\t<mml:mrow>\n\t\t<mml:mo form=\"prefix\">(</mml:mo>\n\t\t<mml:mi>x</mml:mi>\n\t\t<mml:mo form=\"postfix\">)</mml:mo>\n\t</mml:mrow>\n</mml:mrow>\n</mml:math> and, therefore, is better than <mml:math>\n<mml:mrow>\n\t<mml:mstyle mathvariant=\"normal\">\n\t\t<mml:mi>L</mml:mi>\n\t\t<mml:mi>i</mml:mi>\n\t</mml:mstyle>\n\t<mml:mrow>\n\t\t<mml:mo form=\"prefix\">(</mml:mo>\n\t\t<mml:mi>x</mml:mi>\n\t\t<mml:mo form=\"postfix\">)</mml:mo>\n\t</mml:mrow>\n</mml:mrow>\n</mml:math> for small <mml:math>\n<mml:mrow>\n\t<mml:mi>x</mml:mi>\n\t<mml:mo>.</mml:mo>\n</mml:mrow>\n</mml:math> We show that <mml:math>\n<mml:mrow>\n\t<mml:mi>h</mml:mi>\n\t<mml:mrow>\n\t\t<mml:mo form=\"prefix\">(</mml:mo>\n\t\t<mml:mi>x</mml:mi>\n\t\t<mml:mo form=\"postfix\">)</mml:mo>\n\t</mml:mrow>\n</mml:mrow>\n</mml:math> and their extensions are more accurate than other famous approximations, such as Locker–Ernst's or Legendre's also for large <mml:math>\n<mml:mrow>\n\t<mml:mi>x</mml:mi>\n\t<mml:mo>.</mml:mo>\n</mml:mrow>\n</mml:math> In addition, we derive another function <mml:math>\n<mml:mrow>\n\t<mml:mi>g</mml:mi>\n\t<mml:mrow>\n\t\t<mml:mo form=\"prefix\">(</mml:mo>\n\t\t<mml:mi>x</mml:mi>\n\t\t<mml:mo form=\"postfix\">)</mml:mo>\n\t</mml:mrow>\n</mml:mrow>\n</mml:math> based on the geometric mean integral that employs <mml:math>\n<mml:mrow>\n\t<mml:mi>h</mml:mi>\n\t<mml:mrow>\n\t\t<mml:mo form=\"prefix\">(</mml:mo>\n\t\t<mml:mi>x</mml:mi>\n\t\t<mml:mo form=\"postfix\">)</mml:mo>\n\t</mml:mrow>\n</mml:mrow>\n</mml:math> as an input, and allows one to significantly improve the quality of this method. We show that <mml:math>\n<mml:mrow>\n\t<mml:mi>g</mml:mi>\n\t<mml:mrow>\n\t\t<mml:mo form=\"prefix\">(</mml:mo>\n\t\t<mml:mi>x</mml:mi>\n\t\t<mml:mo form=\"postfix\">)</mml:mo>\n\t</mml:mrow>\n</mml:mrow>\n</mml:math> is within <mml:math>\n<mml:mrow>\n\t<mml:mo>≈</mml:mo>\n\t<mml:mn>25</mml:mn>\n</mml:mrow>\n</mml:math> of the actual value for <mml:math>\n<mml:mrow>\n\t<mml:mi>x</mml:mi>\n\t<mml:mo>≤</mml:mo>\n\t<mml:mn>50000</mml:mn>\n</mml:mrow>\n</mml:math> (to compare <mml:math>\n<mml:mrow>\n\t<mml:mstyle mathvariant=\"normal\">\n\t\t<mml:mi>L</mml:mi>\n\t\t<mml:mi>i</mml:mi>\n\t</mml:mstyle>\n\t<mml:mrow>\n\t\t<mml:mo form=\"prefix\">(</mml:mo>\n\t\t<mml:mi>x</mml:mi>\n\t\t<mml:mo form=\"postfix\">)</mml:mo>\n\t</mml:mrow>\n</mml:mrow>\n</mml:math> lies within <mml:math>\n<mml:mrow>\n\t<mml:mo>≈</mml:mo>\n\t<mml:mn>40</mml:mn>\n</mml:mrow>\n</mml:math> for the same range) and asymptotically <mml:math>\n<mml:mrow>\n\t<mml:mi>g</mml:mi>\n\t<mml:mrow>\n\t\t<mml:mo form=\"prefix\">(</mml:mo>\n\t\t<mml:mi>x</mml:mi>\n\t\t<mml:mo form=\"postfix\">)</mml:mo>\n\t</mml:mrow>\n\t<mml:mo>∼</mml:mo>\n\t<mml:mstyle scriptlevel=\"0\" displaystyle=\"true\">\n\t\t<mml:mrow>\n\t\t\t<mml:mfrac linethickness=\"1\">\n\t\t\t\t<mml:mi>x</mml:mi>\n\t\t\t\t<mml:mrow>\n\t\t\t\t\t<mml:mi>ln</mml:mi>\n\t\t\t\t\t<mml:mi>x</mml:mi>\n\t\t\t\t</mml:mrow>\n\t\t\t</mml:mfrac>\n\t\t</mml:mrow>\n\t</mml:mstyle>\n\t<mml:mi>exp</mml:mi>\n\t<mml:mrow>\n\t\t<mml:mo rspace=\"0.3em\" lspace=\"0em\" stretchy=\"true\" fence=\"true\" form=\"prefix\">(</mml:mo>\n\t\t<mml:mstyle scriptlevel=\"0\" displaystyle=\"true\">\n\t\t\t<mml:mrow>\n\t\t\t\t<mml:mfrac linethickness=\"1\">\n\t\t\t\t\t<mml:mn>1</mml:mn>\n\t\t\t\t\t<mml:mrow>\n\t\t\t\t\t\t<mml:mi>ln</mml:mi>\n\t\t\t\t\t\t<mml:mi>x</mml:mi>\n\t\t\t\t\t\t<mml:mo>-</mml:mo>\n\t\t\t\t\t\t<mml:mn>1</mml:mn>\n\t\t\t\t\t</mml:mrow>\n\t\t\t\t</mml:mfrac>\n\t\t\t</mml:mrow>\n\t\t</mml:mstyle>\n\t\t<mml:mo rspace=\"0em\" lspace=\"0.3em\" stretchy=\"true\" fence=\"true\" form=\"postfix\">)</mml:mo>\n\t</mml:mrow>\n\t<mml:mo>.</mml:mo>\n</mml:mrow>\n</mml:math></jats:p>","PeriodicalId":163365,"journal":{"name":"Ukrains’kyi Matematychnyi Zhurnal","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-11-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"New fast methods to compute the number of primes less than a given value\",\"authors\":\"G. R. P. Teruel\",\"doi\":\"10.37863/umzh.v74i9.6193\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<jats:p>\\n\\n\\nUDC 519.688\\n\\n\\n\\nThe paper describes new fast algorithms for evaluating <mml:math>\\n<mml:mrow>\\n\\t<mml:mi>π</mml:mi>\\n\\t<mml:mrow>\\n\\t\\t<mml:mo form=\\\"prefix\\\">(</mml:mo>\\n\\t\\t<mml:mi>x</mml:mi>\\n\\t\\t<mml:mo form=\\\"postfix\\\">)</mml:mo>\\n\\t</mml:mrow>\\n</mml:mrow>\\n</mml:math> inspired by the harmonic and geometric mean integrals that can be used on any pocket calculator. In particular, the formula <mml:math>\\n<mml:mrow>\\n\\t<mml:mi>h</mml:mi>\\n\\t<mml:mrow>\\n\\t\\t<mml:mo form=\\\"prefix\\\">(</mml:mo>\\n\\t\\t<mml:mi>x</mml:mi>\\n\\t\\t<mml:mo form=\\\"postfix\\\">)</mml:mo>\\n\\t</mml:mrow>\\n</mml:mrow>\\n</mml:math> based on the harmonic mean is within <mml:math>\\n<mml:mrow>\\n\\t<mml:mo>≈</mml:mo>\\n\\t<mml:mn>15</mml:mn>\\n</mml:mrow>\\n</mml:math> of the actual value for <mml:math>\\n<mml:mrow>\\n\\t<mml:mn>3</mml:mn>\\n\\t<mml:mo>≤</mml:mo>\\n\\t<mml:mi>x</mml:mi>\\n\\t<mml:mo>≤</mml:mo>\\n\\t<mml:mn>10000.</mml:mn>\\n</mml:mrow>\\n</mml:math> The approximation verifies the inequality, <mml:math>\\n<mml:mrow>\\n\\t<mml:mi>h</mml:mi>\\n\\t<mml:mrow>\\n\\t\\t<mml:mo form=\\\"prefix\\\">(</mml:mo>\\n\\t\\t<mml:mi>x</mml:mi>\\n\\t\\t<mml:mo form=\\\"postfix\\\">)</mml:mo>\\n\\t</mml:mrow>\\n\\t<mml:mo>≤</mml:mo>\\n\\t<mml:mstyle mathvariant=\\\"normal\\\">\\n\\t\\t<mml:mi>L</mml:mi>\\n\\t\\t<mml:mi>i</mml:mi>\\n\\t</mml:mstyle>\\n\\t<mml:mrow>\\n\\t\\t<mml:mo form=\\\"prefix\\\">(</mml:mo>\\n\\t\\t<mml:mi>x</mml:mi>\\n\\t\\t<mml:mo form=\\\"postfix\\\">)</mml:mo>\\n\\t</mml:mrow>\\n</mml:mrow>\\n</mml:math> and, therefore, is better than <mml:math>\\n<mml:mrow>\\n\\t<mml:mstyle mathvariant=\\\"normal\\\">\\n\\t\\t<mml:mi>L</mml:mi>\\n\\t\\t<mml:mi>i</mml:mi>\\n\\t</mml:mstyle>\\n\\t<mml:mrow>\\n\\t\\t<mml:mo form=\\\"prefix\\\">(</mml:mo>\\n\\t\\t<mml:mi>x</mml:mi>\\n\\t\\t<mml:mo form=\\\"postfix\\\">)</mml:mo>\\n\\t</mml:mrow>\\n</mml:mrow>\\n</mml:math> for small <mml:math>\\n<mml:mrow>\\n\\t<mml:mi>x</mml:mi>\\n\\t<mml:mo>.</mml:mo>\\n</mml:mrow>\\n</mml:math> We show that <mml:math>\\n<mml:mrow>\\n\\t<mml:mi>h</mml:mi>\\n\\t<mml:mrow>\\n\\t\\t<mml:mo form=\\\"prefix\\\">(</mml:mo>\\n\\t\\t<mml:mi>x</mml:mi>\\n\\t\\t<mml:mo form=\\\"postfix\\\">)</mml:mo>\\n\\t</mml:mrow>\\n</mml:mrow>\\n</mml:math> and their extensions are more accurate than other famous approximations, such as Locker–Ernst's or Legendre's also for large <mml:math>\\n<mml:mrow>\\n\\t<mml:mi>x</mml:mi>\\n\\t<mml:mo>.</mml:mo>\\n</mml:mrow>\\n</mml:math> In addition, we derive another function <mml:math>\\n<mml:mrow>\\n\\t<mml:mi>g</mml:mi>\\n\\t<mml:mrow>\\n\\t\\t<mml:mo form=\\\"prefix\\\">(</mml:mo>\\n\\t\\t<mml:mi>x</mml:mi>\\n\\t\\t<mml:mo form=\\\"postfix\\\">)</mml:mo>\\n\\t</mml:mrow>\\n</mml:mrow>\\n</mml:math> based on the geometric mean integral that employs <mml:math>\\n<mml:mrow>\\n\\t<mml:mi>h</mml:mi>\\n\\t<mml:mrow>\\n\\t\\t<mml:mo form=\\\"prefix\\\">(</mml:mo>\\n\\t\\t<mml:mi>x</mml:mi>\\n\\t\\t<mml:mo form=\\\"postfix\\\">)</mml:mo>\\n\\t</mml:mrow>\\n</mml:mrow>\\n</mml:math> as an input, and allows one to significantly improve the quality of this method. We show that <mml:math>\\n<mml:mrow>\\n\\t<mml:mi>g</mml:mi>\\n\\t<mml:mrow>\\n\\t\\t<mml:mo form=\\\"prefix\\\">(</mml:mo>\\n\\t\\t<mml:mi>x</mml:mi>\\n\\t\\t<mml:mo form=\\\"postfix\\\">)</mml:mo>\\n\\t</mml:mrow>\\n</mml:mrow>\\n</mml:math> is within <mml:math>\\n<mml:mrow>\\n\\t<mml:mo>≈</mml:mo>\\n\\t<mml:mn>25</mml:mn>\\n</mml:mrow>\\n</mml:math> of the actual value for <mml:math>\\n<mml:mrow>\\n\\t<mml:mi>x</mml:mi>\\n\\t<mml:mo>≤</mml:mo>\\n\\t<mml:mn>50000</mml:mn>\\n</mml:mrow>\\n</mml:math> (to compare <mml:math>\\n<mml:mrow>\\n\\t<mml:mstyle mathvariant=\\\"normal\\\">\\n\\t\\t<mml:mi>L</mml:mi>\\n\\t\\t<mml:mi>i</mml:mi>\\n\\t</mml:mstyle>\\n\\t<mml:mrow>\\n\\t\\t<mml:mo form=\\\"prefix\\\">(</mml:mo>\\n\\t\\t<mml:mi>x</mml:mi>\\n\\t\\t<mml:mo form=\\\"postfix\\\">)</mml:mo>\\n\\t</mml:mrow>\\n</mml:mrow>\\n</mml:math> lies within <mml:math>\\n<mml:mrow>\\n\\t<mml:mo>≈</mml:mo>\\n\\t<mml:mn>40</mml:mn>\\n</mml:mrow>\\n</mml:math> for the same range) and asymptotically <mml:math>\\n<mml:mrow>\\n\\t<mml:mi>g</mml:mi>\\n\\t<mml:mrow>\\n\\t\\t<mml:mo form=\\\"prefix\\\">(</mml:mo>\\n\\t\\t<mml:mi>x</mml:mi>\\n\\t\\t<mml:mo form=\\\"postfix\\\">)</mml:mo>\\n\\t</mml:mrow>\\n\\t<mml:mo>∼</mml:mo>\\n\\t<mml:mstyle scriptlevel=\\\"0\\\" displaystyle=\\\"true\\\">\\n\\t\\t<mml:mrow>\\n\\t\\t\\t<mml:mfrac linethickness=\\\"1\\\">\\n\\t\\t\\t\\t<mml:mi>x</mml:mi>\\n\\t\\t\\t\\t<mml:mrow>\\n\\t\\t\\t\\t\\t<mml:mi>ln</mml:mi>\\n\\t\\t\\t\\t\\t<mml:mi>x</mml:mi>\\n\\t\\t\\t\\t</mml:mrow>\\n\\t\\t\\t</mml:mfrac>\\n\\t\\t</mml:mrow>\\n\\t</mml:mstyle>\\n\\t<mml:mi>exp</mml:mi>\\n\\t<mml:mrow>\\n\\t\\t<mml:mo rspace=\\\"0.3em\\\" lspace=\\\"0em\\\" stretchy=\\\"true\\\" fence=\\\"true\\\" form=\\\"prefix\\\">(</mml:mo>\\n\\t\\t<mml:mstyle scriptlevel=\\\"0\\\" displaystyle=\\\"true\\\">\\n\\t\\t\\t<mml:mrow>\\n\\t\\t\\t\\t<mml:mfrac linethickness=\\\"1\\\">\\n\\t\\t\\t\\t\\t<mml:mn>1</mml:mn>\\n\\t\\t\\t\\t\\t<mml:mrow>\\n\\t\\t\\t\\t\\t\\t<mml:mi>ln</mml:mi>\\n\\t\\t\\t\\t\\t\\t<mml:mi>x</mml:mi>\\n\\t\\t\\t\\t\\t\\t<mml:mo>-</mml:mo>\\n\\t\\t\\t\\t\\t\\t<mml:mn>1</mml:mn>\\n\\t\\t\\t\\t\\t</mml:mrow>\\n\\t\\t\\t\\t</mml:mfrac>\\n\\t\\t\\t</mml:mrow>\\n\\t\\t</mml:mstyle>\\n\\t\\t<mml:mo rspace=\\\"0em\\\" lspace=\\\"0.3em\\\" stretchy=\\\"true\\\" fence=\\\"true\\\" form=\\\"postfix\\\">)</mml:mo>\\n\\t</mml:mrow>\\n\\t<mml:mo>.</mml:mo>\\n</mml:mrow>\\n</mml:math></jats:p>\",\"PeriodicalId\":163365,\"journal\":{\"name\":\"Ukrains’kyi Matematychnyi Zhurnal\",\"volume\":\"1 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2022-11-08\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Ukrains’kyi Matematychnyi Zhurnal\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.37863/umzh.v74i9.6193\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Ukrains’kyi Matematychnyi Zhurnal","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.37863/umzh.v74i9.6193","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
New fast methods to compute the number of primes less than a given value
UDC 519.688
The paper describes new fast algorithms for evaluating π(x) inspired by the harmonic and geometric mean integrals that can be used on any pocket calculator. In particular, the formula h(x) based on the harmonic mean is within ≈15 of the actual value for 3≤x≤10000. The approximation verifies the inequality, h(x)≤Li(x) and, therefore, is better than Li(x) for small x. We show that h(x) and their extensions are more accurate than other famous approximations, such as Locker–Ernst's or Legendre's also for large x. In addition, we derive another function g(x) based on the geometric mean integral that employs h(x) as an input, and allows one to significantly improve the quality of this method. We show that g(x) is within ≈25 of the actual value for x≤50000 (to compare Li(x) lies within ≈40 for the same range) and asymptotically g(x)∼xlnxexp(1lnx-1).