Three primes
Practice
4.3 (10 votes)
Medium
Basic math
Mathematics
Mathematics
Problem
85% Success 2493 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

A triplet \((p1,p2,p3)\) where \(p1,p2,p3\) are primes (not necessarily distinct) is called special if \(p1+p2+p3\) divides \(p1*p2*p3\). Find the number of triplets such that each prime of the triplet is not greater than \(N\). Two triplets are considered to be different if the element at any one of the positions (first, second, third) is different in the second one.

Input format

The first line of the input consists of an integer \(N\).

Output format

Print the answer in a single line.

Constraints

\(1<=N<=10^6\)

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:30
3 votes
Tags:
MathematicsMedium
Points:30
46 votes
Tags:
GeometryImplementationOpenAlgorithmsApprovedMedium
Points:30
Tags:
HiringOpenHiringOpenImplementationHiringMathematicsEasyBasic ProgrammingMathematicsMathematicsMathamatics