luogu#P4844. LJJ爱数数
LJJ爱数数
Background
For the solution, please see https://www.cnblogs.com/Blog-of-Eden/p/9367521.html。
Problem Description
Once when reading a magazine, PJY saw a problem:
Find all positive integer triples such that , the greatest common divisor of the three numbers is , and .
PJY thought this problem was too easy, so he threw it to LJJ, who loves counting, and added the Constraints , asking LJJ to count how many triples satisfy the conditions
(note that when , and are different triples and should be counted twice).
Halfway through counting, LJJ found that the number was too large, so he passed the problem to you. Please output this number.
Input Format
Only one line: a positive integer 。
Output Format
Only one line: an integer, representing the number of triples that satisfy the conditions.
10
3
100
43
100000
42139
Hint
For of the testdata, 。
For of the testdata, 。
For of the testdata, 。
For of the testdata, 。
For of the testdata, 。
Translated by ChatGPT 5