Little Monty and Fibonacci
Practice
3 (5 votes)
Hard
Number theory
Algorithms
Mathematics
Open
Approved
Problem
88% Success 2996 Attempts 50 Points 5s Time Limit 256MB Memory 1024 KB Max Code

Little Monty is very fond of Fibonacci numbers and challenges his friend Lopa that he can solve any question regarding the same. Lopa however is jealous and after thinking for a long time came up with a problem.
She says given N(the number of fibonacci numbers) one has to count all the multiples of all the fibonacci numbers. This statement can be quite confusing hence look at the mathematical definition and test cases for better understanding.
Let M(x) denote the number of multiple of x in the sequence and F(y) denote the yth fibonacci number. The required answer is:
enter image description here Take the first two number of the sequence to be 1 and 1.

Input Format
The first line contains T i.e. the number of test cases.
T lines follow, each line containing an integer, N.
(The sample fibonacci series for n=5 is 1, 1, 2, 3, 5)

Output Format
For each testcase, print the output that Lopa wants in one line.

Constraints
1 ≤ T ≤ 1000
1 ≤ N ≤ 1000

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:50
Tags:
Integer FactorizationBasics of ImplementationImplementationMathematicsMathNumber Theory
Points:50
1 votes
Tags:
MathematicsSieveHardNumber TheoryFactorization
Points:50
Tags:
Hard