附图:
附链接:quickmath
Multiples of 3 and 5.
The first two consecutive numbers to have two distinct prime factors are:
14 = 2 7
15 = 3 5
The first three consecutive numbers to have three distinct prime factors are:
644 = 2² 7 23
645 = 3 5 43
646 = 2 17 19.
Find the first four consecutive integers to have four distinct prime factors. What is the first of these numbers?
Go to the thread for problem 47 in the forum.
n=1000000
a=[0 for i in range(n+1)]
i=2
while i< =n:
if (a[i]==0):
j=2*i
while j
The series, 11 + 22 + 33 + ... + 1010 = 10405071317.
Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.
Go to the thread for problem 48 in the forum.
ans=0
i=1
F=10**10
for i in range(1,1001):
p=1
for j in range(i): p=p*i%F
ans=(ans+p)%F
print i
print ans
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
Go to the thread for problem 3 in the forum.
import math
n=600851475143
i=2
print math.sqrt(n)
while i< =math.sqrt(n):
if (n%i==0):
while (n%i==0): n=n/i
print i;
i=i+1
print n
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
Go to the thread for problem 2 in the forum.
Even(是偶数的意思……(─.─|||
f=[1,1,1]
i=2
ans=0
while f[i]+f[i-1]<4000000:
i=i+1
f.append(f[i-1]+f[i-2])
if (f[i]%2==0): ans=ans+f[i]
print sum(f)-1,f,ans
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define MAXN (1000)
int main()
{
long long ans=0;
for (int i=1;i<1000;i++)
if (!(i%3&&i%5)) ans+=i;
cout< <333*3+5*199<