Hey guys, 

Hope you all are doing great. I am back with another problem of Project Euler on

Project Euler #6: Sum square difference

The sum of the squares of the first ten natural numbers is, 12+22+...+102=385. The square of the sum of the first ten natural numbers is, (1+2+⋯+10)2=552=3025. Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025−385=2640.

Find the difference between the sum of the squares of the first N natural numbers and the square of the sum.

Input Format

First line contains T that denotes the number of test cases. This is followed by T lines, each containing an integer, N.

Output Format

Print the required answer for each test case.
1

Hey guys, 

Hope you all are doing great. I am back with another problem of Project Euler on

Project Euler #5: Smallest multiple

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.

What is the smallest positive number that is evenly divisible(divisible with no remainder) by all of the numbers from 1 to N?

Input Format

First line contains T that denotes the number of test cases. This is followed by T lines, each containing an integer, N.

Hey guys, 

Hope you all are doing great. I am back with another problem of Project Euler on

Project Euler #3: Largest prime factor

The prime factors of 13195 are 5, 7, 13 and 29.

What is the largest prime factor of a given number N?

Input Format

First line contains T, the number of test cases. This is followed by T lines each containing an integer N.

Output Format

For each test case, display the largest prime factor of N.
Loading