Given:
f(n) is the number of integers that:
1) is less than n
2) has no factors in common with n
Question: f(p) where p is a prime number.
If p is an even number, then half the numbers less than it would share a common factor (namely the number 2). However, the question is asking for prime numbers.
The answer is that NO number less than than a prime number share a factor as the prime number, by definition. Therefore, EVERY integer less than p has no factors and should be counted. This is how you get:
A) f(p) = p - 1 since you are not counting p itself.
Part of the trick is that you need to count 1 also. I thought about not counting this when looking at f(2) = count of (1)
Also, let's look at some other wording:
-if you are asking f(even number): All even numbers share the factor 2. Then you could also share certain odd numbers (example, 6 contains 3 as a factor, therefore, 1 and 5 are the only numbers less than 6 to count)
-if you are asking f(odd number): You need to determine if it shares with odds (15 would not count 5 and 3. I also shares a factor with 10 and 6, because they share the factor 5 and 3 respectively. however 8 is 2^3 so there is no common there)
- f(prime) is the special case of odd numbers (and the number 2) as described above, but easier to figure out.
BREAKING: Target Test Prep releases Brand New 2026 On Demand GMAT prep course
Redeem
Target Test Prep GMAT OnDemand
Scott Woodbury-Stewart’s private virtual classroom — 400 hours of master-class video lessons for the GMAT Focus Edition.
- 715+ score guarantee — highest in the industry (99th percentile)
- 52 chapters · 1,500+ lessons · 4,000+ practice questions
- 400 hours of video · 1,500+ instructor-led HD smartboard lessons
- 300,000+ students accepted to Harvard, Stanford, Wharton, Booth & Sloan & more
- 24/7 live support + weekly Zoom office hours with GMAT instructors
- TTP AI Assist — 24/7 AI-powered virtual tutor for instant help
- 1,200+ flashcards + AI-powered study assistant & daily calendar
- OnDemand, LiveTeach & GMAT Bootcamp formats available
- Also: GRE, SAT Math & Executive Assessment courses
- MBA Admissions Consulting now available
- 🏆 2025 EdTech Breakthrough Award: Test Prep Solution Provider of the Year
- 200,000+ students served
- 5-day free trial — $0 to start, no auto-billing, cancel anytime
★★★★★
5.0
(559 reviews)
130-pt guarantee
$0 to start
then $127/mo
















