Problem 7
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10 001st prime number?
求:从第一到第10001个质数和
思路
- 先求10001个质数矩阵
- 求和
代码
%% 7
i=1:200000;
k=isprime(i); %判断x是否为质数,是返回1,不是返回0
k1=find(k);
i=k1(10001);
sum(i)
答案
Answer:
104743