GCD problem
Practice
4 (47 votes)
Medium Hard
Mobius inversion
Number theory
Mathematics
Greatest common divisor
Problem
45% Success 6742 Attempts 50 Points 5s Time Limit 256MB Memory 1024 KB Max Code

For each set of four integers given \((i,j ,k,l)\) where \(1\leq i < j <k <l \leq N\). You are required to compute the following:

\(\displaystyle\sum_{i=1}^{N} \displaystyle\sum_{j=i+1}^{N}\displaystyle\sum_{k=j+1}^{N} \displaystyle\sum_{l=k+1}^{N} gcd(i,j,k,l) ^{4}\)

Input format

  • First line: \(T\) that denotes the number of test cases
  • Next \(T\) lines: A integer \(N\)

Output format

Print the answer for each test case \(Mod \,\,\,10^9+7\) in a new line.

Constraints
\(1 \leq T \leq 10 \\ 1 \leq N \leq 10^5\)

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
1 votes
Tags:
Extended EuclidGreatest common divisorMedium-HardMathematicsOpenApproved
Points:50
1 votes
Tags:
Number TheoryAlgorithmsGCDMathGreedy algorithm
Points:50
72 votes
Tags:
ReadyBasic ProgrammingMedium-HardGreatest common divisorMathematics