Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a method or a function to generate integers that are only divisible by 3?

share|cite|improve this question
If you mean by $3$ and no other prime, then $3^n$. – Alex Becker Jan 6 '13 at 4:48
@RahulNarain $3*4=12$, $12 mod2 = 0$ – Babiker Jan 6 '13 at 4:51
What do you mean? If $n$ is an integer divisible by $3$, then we have another integer $n/3$ which also divides $n$. So I guess the only solution to your problem is the constant function $3$. – Hui Yu Jan 6 '13 at 4:55
@AlexBecker Thanks, I'll be glad to accept your answer. – Babiker Jan 6 '13 at 4:55
Wow...I just remembered the Fundamental Theorem of Arithmetic and realized how big of a brain fart that was. – Babiker Jan 6 '13 at 4:57
up vote 4 down vote accepted

Every integer is also divisible by $1$, so the collection is empty.

If you're OK with having $1$ as a divisor, every integer is also divisible by itself, so it's just $3$.

If you mean the set of integers for which $3$ is the only prime divisor then you may use the following algorithm:

 1. Let x = 3 and S be empty.
 2. Add x and -x to S.
 3. Multiply x by 3 and set x equal to that.
 4. Go to 2.
share|cite|improve this answer

There is no integer that is only divisible by $3$. Every integer is always divisible by $1$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.