当前位置:网站首页>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 :
边栏推荐
- DVWA全级别通关教程
- Get the data of the first frame of unity's open camera
- @Detailed explanation of repository
- MySQL save data prompt: out of range value for column error
- 汉字风格迁移篇---对抗性区分域适应(L1)Adversarial Discriminative Domain Adaptation
- @Repository详解
- Getting started for beginners: build your own blog with WordPress
- STM32 - capacitive touch button experiment
- Photo album based on gec6818 development board
- Spark job uses log4j appender to append logs to local files or mysql
猜你喜欢

面试官问:如何判断一个元素是否在可视区域?

Skywalking distributed system application performance monitoring tool - medium

这年头谁还不会抓包,WireShark 抓包及常用协议分析送给你!

Who can't capture packets these days? Wireshark packet capture and common protocol analysis are for you!

PROFINET simulator tutorial

Docker实践经验:Docker 上部署 mysql8 主从复制

Architecture - the sublimation of MVC

Docker practical experience: deploy mysql8 master-slave replication on docker

Research on multi label patent classification based on pre training model

Toward fast, flexible, and robust low light image enhancement cvpr2022
随机推荐
Database storage series (1) column storage
PROFINET 模拟器使用教程
【STM32】EXTI
面试官问:如何判断一个元素是否在可视区域?
Ten thousand words detailed Google play online application standard package format AAB
Document translation__ Salt and pepper image denoising based on adaptive total variation L1 regularization
巨形象的图解 SQL
MySQL save data prompt: out of range value for column error
How to do well in enterprise system vulnerability assessment
线程知识总结
自动化配置SSH免密登录和取消SSH免密配置脚本
Nokia's patent business was hit for the first time, and Chinese enterprises are not so easy to knead
Failed to connect to ResourceManager
telnet远程登录aaa模式详解【华为eNSP】
c语言分层理解(c语言数组)
[medical industry] DICOM converter tools
Detailed explanation of Telnet remote login AAA mode [Huawei ENSP]
动态规划——股票买卖5
在Oracle VirtualBox中导入Kali Linux官方制作的虚拟机
股票买卖4