当前位置:网站首页>Nefu117 number of prime numbers [prime number theorem]
Nefu117 number of prime numbers [prime number theorem]
2022-07-27 14:55:00 【51CTO】
Topic linking :
http://acm.nefu.edu.cn/JudgeOnline/problemshow.php?problem_id=117
The main idea of the topic :
Give you an integer N(1 < N < 1000000000), If it is less than 10^N The number of primes in the integer of is π(N),
So here comes the question : seek π(N) What are the digits of .
Ideas :
The number of primes π(N) There is a prime theorem :π(N) = N/ln(N). In this question π(10^N) = 10^N/ln(10^N).
The problem is transformed into : seek N^10*ln(N^10) How many people are there . Co ownership x position , Available 10^x = 10^N/ln(10^N).
Take logarithms on both sides at the same time log10, have to :
10^x = N^10 / ln(N^10)
log10(10^x) = log10( 10^N / ln(10^N) )
x = N - log10( ln(10^N) )
x = N - ( log10(N) + log10( ln10 )
x = N - log10(N) - log10( ln10 )
Last x integer +1, Get the corresponding digits .
Prime number theorem :
Positive real numbers x, Definition π(x) Is not greater than x The prime number of . When x Approach ∞,π(x) and x/ln x Ratio approach of 1.
AC Code :
边栏推荐
- Stock trading 4
- Construction and empirical research of post talent demand analysis framework based on recruitment advertisement
- 2022 Niuke multi School II_ E I
- web上构建3d效果 基于three.js的实例
- JS what is declaration in advance? The order of function and variable declaration in advance (the foreshadowing of execution context)
- Ten thousand words detailed Google play online application standard package format AAB
- How to help enterprises optimize office management
- 【WORK】关于技术架构
- Dynamic programming - stock trading 5
- 基于GEC6818开发板的相册
猜你喜欢

Thread knowledge summary

Redis

动态规划——股票买卖5

FPGA时序约束分享04_output delay 约束

Skywalking distributed system application performance monitoring tool - medium

进程间通信

如果我们是那晚负责修复 B 站崩了的开发人员

Simple encapsulation steps of request data request of uniapp

Navicate reports an error access violation at address 00000000

【WORK】关于技术架构
随机推荐
Unityui aspect processing (induction and accumulation)
数据库使用psql及jdbc进行远程连接,不定时自动断开的解决办法
Understand the evolution of redis architecture in one article
The database uses PSQL and JDBC to connect remotely and disconnect automatically from time to time
Get the data of the first frame of unity's open camera
Visual system design example (Halcon WinForm) -10. PLC communication
Getting started with DirectX
FPGA timing constraint sharing 04_ Output delay constraint
如何做好企业系统漏洞评估
[medical industry] DICOM converter tools
2022 Niuke multi School II_ E I
2022牛客多校二_ E I
[ManageEngine] what is Siem
基于GEC6818开发板的相册
Research on multi label patent classification based on pre training model
OBS advanced DXGI acquisition screen process, and how to modify it to its own cursor
NEFU119 组合素数【算术基本定理】
@Bean 与 @Component 用在同一个类上,会发生什么?
Interprocess communication
Toward Fast, Flexible, and Robust Low-Light Image Enhancement(实现快速、灵活和稳健的弱光图像增强)CVPR2022