# Prime factorization rules

When you have a number like 81.

Is it safe to assume that if the number can't be divided by 2 or 3 that it's prime if it ends with a 1?

-

## 2 Answers

On a related note, you should realize that a number which ends in a 1 is NEVER divisible by 2 since it is odd. Also, ending with a 1 has nothing to do with the number being prime, and in fact there are infinitely many such primes by Dirchlet's theorem on primes in arithmetic progressions since 11,21,31,41,... is an arithmetic progression. In fact, the primes which end in 1 have the same relative density as those ending in 3,7, or 9 (the only other possibilities which lead to infinitely many primes since all others are divisible by either 2 or 5).

-

1
Moreover there are infinitely many composites ending in $1$. More preicsely, knowing that a large number has final decimal digit $1$ does not affect its "probability" of being prime, a consequence of the Prime Number Theorem in Arithmetic Progressions. – Pete L. Clark Jun 14 '11 at 22:43

1
+1: @Rofler: Nice answer! – amWhy Jun 14 '11 at 22:49
+1 @Rofler: Well put. – Jack Henahan Jun 14 '11 at 23:25

Definitely not, the smallest two examples are $91=7\times 13$ and $121=11\times 11$. (I am not counting $1$ as an example, though technically it qualifies!)

In fact, there are infinitely many non-primes of the required type, that is, ending in a $1$ and not divisible by $3$. There are also infinitely many primes of that type.

With smallish numbers, a substantial proportion of the numbers of the required type are prime. But after a while, the primes of that type "thin out". If you pick a huge number of that type "at random", then with high probability it will be a non-prime.

Comment: You can "roll your own" counterexamples. Suppose that one of the following holds:

(i) $a$ and $b$ end in $1$ and are not divisible by $3$, or

(ii) $a$ and $b$ end in $9$ and are not divisible by $3$, or

(iii) one of $a$ and $b$ ends in a $3$, the other in a $7$, and neither is divisible by $3$.

Then $a \times b$ ends in a $1$, is not divisible by $3$, and is not prime.

So for example pick $a=11$, $b=31$. Their product $341$ ends in a $1$, is not divisible by $3$, and is not prime.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 28, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.955451488494873, "perplexity_flag": "head"}