Archivi tag: C

Project Euler #3

Question: What is the largest prime factor of the number 600851475143? Solution: Answer: Con n = 600851475143 l’algoritmo ritorna big_prime_factor = 6857.

Project Euler #2

Question: By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms. Solution: Answer: Con fib_max = 4000000 l’algoritmo ritorna sum = 4613732.

Project Euler #1

Question: Find the sum of all the multiples of 3 or 5 below 1000. Solution: Answer: Con a = 3, b = 5 e n=1000 l’algoritmo ritorna sum = 233168.