Conway’s factoring trick

The numbers 152 through 156 have a great deal of little prime factors. Ill be more specific about that shortly, but take my word for it in the meantime. John Conway [1] took this easy observation and turned it into a technique for psychologically factoring integers.

Conways factoring method

To search for factors of a number n, write n as a numerous of 150 and a remainder:

n = 150k + r.

We started from the presumption that the numbers 152 through 156 are interesting, so let j = 2 through 6 and observe

n = (150 + j) k + (r– jk).

N is divisible by one of the elements of 150 + j if and only if r– jk is divisible by the exact same factor. So we can evaluate n for divisibility by any of the aspects of the numbers 152 through 156 by screening r– jk for divisibility by the exact same aspects. Here r is less than 150, so youre working with moderately little numbers.

Details and examples

Here are the factorizations of the numbers 152 through 156:

152 = 2 ³ × 19153 = 3 ² × 17154 = 2 × 7 × 11155 = 5 × 31156 = 2 ² × 3 × 13

Example

So the technique above will check for divisibility by 2, 3, 5, 7, 11, 13, 17, 19, and 31, which is all of the primes below 41 other than for 23, 29, and 37. Conway developed a variation of his technique to cover these primes, and another variation to cover primes as much as 67. See [1] for information.

So lets do an example. Let n = 817.

817 = 750 + 67 = 150 × 5 + 67

and so k = 5 and r = 67.

Its easy to see that n is not divisible by 2, 3, or 5. (You could test n straight for divisibility by 2, 3, and 5 or test r.).

Now lets look at 67– 5j for j = 2 through 6. 57 = 19 × 3, so 817 is divisible by 19 (the biggest prime element of 152). Next, 52 is not divisible by 17 (the largest prime aspect of 153).

2nd example.

n = (150 + j) k– (r + jk).

So instead of subtracting multiples of k, from r, we include multiples of k.

and looking at.

Take, for example, n = 887.

n = 150k– r.

In the conversation above, we rounded down to the nearby multiple of 150. We could assemble too, writing n as.

887 = 150 × 6– 13.

for n in range( 1, 1000):.
prod = n *( n +1) *( n +2) *( n +3) *( n +4).
f = factorint( prod).
, if set( [ 2,3,5,7,11,13,17,19]. issubset( f):.
print( n, factorint( prod)).

The set of prime elements of the numbers in [152, 156] include all the primes approximately 19. The following Python script look for periods [n, n + 4] whose elements likewise consist of all primes up to 19. from sympy import factorint.

Finger math.

The facility of Conways factoring approach is that the interval [152, 156] is abnormally rich in small prime elements. Is this interval distinct in some sense?

Why 150?

Conway associated the largest prime aspects of 152 through 156 with the consecutive fingers: thumb for 19,. forefinger for 17, etc. So as he deducted aspects of k, he d track what prime hes screening divisibility for by putting down consecutive fingers.

[1] Arthur T. Benjamin (2018) Factoring Numbers with Conways 150 Method, The College Mathematics Journal, 49:2, 122-12. Readily available here.

N is divisible by one of the factors of 150 + j if and only if r– jk is divisible by the exact same aspect. Let n = 817. Now lets look at 67– 5j for j = 2 through 6. 57 = 19 × 3, so 817 is divisible by 19 (the biggest prime element of 152). We see that 13 + 2 × 6 = 25 is not divisible by 19, 13 + 3 × 6 = 31 is not divisible by 17, 13 + 5 × 6 = 37 is not divisible by 7 or 11, 13 + 5 × 6 = 43 is not divisible by 31, and lastly 13 + 6 × 6 = 49 is not divisible by 13.

We see that 13 + 2 × 6 = 25 is not divisible by 19, 13 + 3 × 6 = 31 is not divisible by 17, 13 + 5 × 6 = 37 is not divisible by 7 or 11, 13 + 5 × 6 = 43 is not divisible by 31, and lastly 13 + 6 × 6 = 49 is not divisible by 13. 887 is not divisible by any of the primes our approach is capable of screening divisibility by.

The interval [986, 990] is perhaps interesting. Its prime aspects include all primes up to 29, in addition to 43 and 47. Its definitely easy to subtract off multiples of 1000, and so you could develop a rule analogous to Conways rule with 1000 playing the function of 150. The disadvantage is that now j runs from -10 to -14 instead of 2 to 6, so youre dealing with larger numbers when subtracting off multiples of k.

K = 6 and r = 13.

This shows that 152 is the smallest value of n. The next worth of n is 285, however it has a number of disadvantages. The variety likewise includes 9 prime aspects, but the biggest is 41 rather than 31.

Related posts.

Leave a Reply

Your email address will not be published.