Skip to main content
added 795 characters in body
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

How it works (WIP)

  • If n = 13 (a twin prime), (n + n%6 - 3)n = 3(3 + 3 - 3) = 9 has two divisors (3 and 9) in [2, 12).

  • If n > 3 is a twin prime, as seen before, m := n + n%6 - 3 is its twin. In this case, mn has exactly four divisors: 1, m, n, mn.

    Since n > 3, we have m > 4, so 4n < mn and exactly two divisors (m and n) fall into the integerinterval [2, 4n).

  • If n = 1, then (n + n%6 - 3)n = 1 + 1 - 3 = -1 has no divisors in [2, 4).

  • If n = 2, the integerthen (n + n%6 - 3)n = 2(2 + 2 - 3) = 2 has one divisor (itself) in [2, 8).

  • If n = 34 (a twin prime), the integerthen (n + n%6 - 3)n = 34(34 + 34 - 3) = 920 has twofour divisors (32, 4, 5, and 910) in [2, 1216).

  • If n => 4 is even, 2, the integern/2, and n all divide n and, therefore, (n + n%6 - 3)n = 4(4 + 4 - 3) = 20 has four divisors. We have (n/2, > 2 since n > 4, 5, 10), so there are at least three divisors in [2, 164n).

  • If n = 69, the integerthen (n + n%6 - 3)n = 69(69 + 03 - 3) = 1881 has fivethree divisors (2, 3, 6, 9, 183, 9, and 21) in [2, 2436).

  • If n > 39 is a twin primemultiple of 3, as seen beforethen 3, m := nn/3, and n all divide n and, therefore, (n + n%6 - 3)n is its twin. In this case,We have mnn/3 > 3 has exactly foursince n > 9, so there are at least three divisors: in 1, m, n[2, mn4n).

     
  • SinceFinally, if n = 6k ± 1 > 4 is not a twin prime, either n or m := n + n%6 - 3 must be composite and, we havetherefore, admit a proper divisor d > 1.

    Since either n = m + 2 or m = n + 2 and n, m > 4, sothe integers 4n < mnd, m, and exactly twon are distinct divisors of (mn. Furthermore, m < n + 3 < 4n andsince n > 1) fall into the interval, so mn has at least three divisors in [2, 4n).

How it works (WIP)

  • If n = 1, the integer (n + n%6 - 3)n = 1 + 1 - 3 = -1 has no divisors in [2, 4).

  • If n = 2, the integer (n + n%6 - 3)n = 2(2 + 2 - 3) = 2 has one divisor (itself) in [2, 8).

  • If n = 3 (a twin prime), the integer (n + n%6 - 3)n = 3(3 + 3 - 3) = 9 has two divisors (3 and 9) in [2, 12).

  • If n = 4, the integer (n + n%6 - 3)n = 4(4 + 4 - 3) = 20 has four divisors (2, 4, 5, 10) in [2, 16).

  • If n = 6, the integer (n + n%6 - 3)n = 6(6 + 0 - 3) = 18 has five divisors (2, 3, 6, 9, 18) in [2, 24).

  • If n > 3 is a twin prime, as seen before, m := n + n%6 - 3 is its twin. In this case, mn has exactly four divisors: 1, m, n, mn.

    Since n > 3, we have m > 4, so 4n < mn and exactly two divisors (m and n) fall into the interval [2, 4n).

How it works

  • If n = 3 (a twin prime), (n + n%6 - 3)n = 3(3 + 3 - 3) = 9 has two divisors (3 and 9) in [2, 12).

  • If n > 3 is a twin prime, as seen before, m := n + n%6 - 3 is its twin. In this case, mn has exactly four divisors: 1, m, n, mn.

    Since n > 3, we have m > 4, so 4n < mn and exactly two divisors (m and n) fall into the interval [2, 4n).

  • If n = 1, then (n + n%6 - 3)n = 1 + 1 - 3 = -1 has no divisors in [2, 4).

  • If n = 2, then (n + n%6 - 3)n = 2(2 + 2 - 3) = 2 has one divisor (itself) in [2, 8).

  • If n = 4, then (n + n%6 - 3)n = 4(4 + 4 - 3) = 20 has four divisors (2, 4, 5, and 10) in [2, 16).

  • If n > 4 is even, 2, n/2, and n all divide n and, therefore, (n + n%6 - 3)n. We have n/2 > 2 since n > 4, so there are at least three divisors in [2, 4n).

  • If n = 9, then (n + n%6 - 3)n = 9(9 + 3 - 3) = 81 has three divisors (3, 9, and 21) in [2, 36).

  • If n > 9 is a multiple of 3, then 3, n/3, and n all divide n and, therefore, (n + n%6 - 3)n. We have n/3 > 3 since n > 9, so there are at least three divisors in [2, 4n).

     
  • Finally, if n = 6k ± 1 > 4 is not a twin prime, either n or m := n + n%6 - 3 must be composite and, therefore, admit a proper divisor d > 1.

    Since either n = m + 2 or m = n + 2 and n, m > 4, the integers d, m, and n are distinct divisors of mn. Furthermore, m < n + 3 < 4n since n > 1, so mn has at least three divisors in [2, 4n).

added 519 characters in body
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

All integers take one of the following forms, with integer k: 6k - 23, 6k - 12, 6k - 1, 6k + 1, 6k + 21, 6k + 32.

Since 6k - 2, 6k, and 6k + 2 are all even, and since 6k +- 3 is divisible by 3, with the exception ofall primes except 2 and 3, all primes must be of the form 6k - 1 or 6k + 1. Since the difference of a twin prime pair is 2, with the exception of (3, 5), all twin prime pairs are of the form (6k - 1, 6k + 1).

  • If n = 1, the integer (n + n%6 - 3)n = 1 + 1 - 3 = -1 has no divisors in [2, 4).

  • If n = 2, the integer (n + n%6 - 3)n = 2(2 + 2 - 3) = 2 has one divisor (itself) in [2, 8).

  • If n = 3 (a twin prime), the integer (n + n%6 - 3)n = 3(3 + 3 - 3) = 9 has two divisors (3 and 9) in [2, 12).

  • If n = 4, the integer (n + n%6 - 3)n = 4(4 + 4 - 3) = 20 has four divisors (2, 4, 5, 10) in [2, 16).

  • If n = 6, the integer (n + n%6 - 3)n = 6(6 + 0 - 3) = 18 has five divisors (2, 3, 6, 9, 18) in [2, 24).

  • If n > 3 is a twin prime, as seen before, m := n + n%6 - 3 is its twin. In this case, mn has exactly four divisors: 1, m, n, mn.

    Since n > 3, we have m > 4, so 4n < mn and exactly two divisors (m and n) fall into the interval [2, 4n).

All integers take one of the following forms, with integer k: 6k - 2, 6k - 1, 6k, 6k + 1, 6k + 2, 6k + 3.

Since 6k - 2, 6k, and 6k + 2 are all even, and since 6k + 3 is divisible by 3, with the exception of 2 and 3, all primes must be of the form 6k - 1 or 6k + 1. Since the difference of a twin prime pair is 2, with the exception of (3, 5), all twin prime pairs are of the form (6k - 1, 6k + 1).

  • If n = 1, the integer (n + n%6 - 3)n = 1 + 1 - 3 = -1 has no divisors in [2, 4).

  • If n = 2, the integer (n + n%6 - 3)n = 2(2 + 2 - 3) = 2 has one divisor (itself) in [2, 8).

  • If n = 3 (a twin prime), the integer (n + n%6 - 3)n = 3(3 + 3 - 3) = 9 has two divisors (3 and 9) in [2, 12).

All integers take one of the following forms, with integer k: 6k - 3, 6k - 2, 6k - 1, 6k, 6k + 1, 6k + 2.

Since 6k - 2, 6k, and 6k + 2 are all even, and since 6k - 3 is divisible by 3, all primes except 2 and 3 must be of the form 6k - 1 or 6k + 1. Since the difference of a twin prime pair is 2, with the exception of (3, 5), all twin prime pairs are of the form (6k - 1, 6k + 1).

  • If n = 1, the integer (n + n%6 - 3)n = 1 + 1 - 3 = -1 has no divisors in [2, 4).

  • If n = 2, the integer (n + n%6 - 3)n = 2(2 + 2 - 3) = 2 has one divisor (itself) in [2, 8).

  • If n = 3 (a twin prime), the integer (n + n%6 - 3)n = 3(3 + 3 - 3) = 9 has two divisors (3 and 9) in [2, 12).

  • If n = 4, the integer (n + n%6 - 3)n = 4(4 + 4 - 3) = 20 has four divisors (2, 4, 5, 10) in [2, 16).

  • If n = 6, the integer (n + n%6 - 3)n = 6(6 + 0 - 3) = 18 has five divisors (2, 3, 6, 9, 18) in [2, 24).

  • If n > 3 is a twin prime, as seen before, m := n + n%6 - 3 is its twin. In this case, mn has exactly four divisors: 1, m, n, mn.

    Since n > 3, we have m > 4, so 4n < mn and exactly two divisors (m and n) fall into the interval [2, 4n).

added 342 characters in body
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

Python 3, 53 bytes

lambda n:sum((n+n%6-3)*n%k<1for k in range(2,4*n))==2

Try it online!

Background

All integers take one of the following forms, with integer k: 6k - 2, 6k - 1, 6k, 6k + 1, 6k + 2, 6k + 3.

Since 6k - 2, 6k, and 6k + 2 are all even, and since 6k + 3 is divisible by 3, with the exception of 2 and 3, all primes must be of the form 6k - 1 or 6k + 1. Since the difference of a twin prime pair is 2, with the exception of (3, 5), all twin prime pairs are of the form (6k - 1, 6k + 1).

Let n be of the form 6k ± 1.

  • If n = 6k -1, then n + n%6 - 3 = 6k - 1 + (6k - 1)%6 - 3 = 6k - 1 + 5 - 3 = 6k + 1.

  • If n = 6k + 1, then n + n%6 - 3 = 6k + 1 + (6k + 1)%6 - 3 = 6k + 1 + 1 - 3 = 6k - 1.

Thus, if n is part of a twin prime pair and n ≠ 3, it's twin will be n + n%6 - 3.

How it works (WIP)

Python doesn't have a built-in primality test. While there are short-ish ways to test a single number for primality, doing so for two number would be lengthy. We're going to work with divisors instead.

sum((n+n%6-3)*n%k<1for k in range(2,4*n))

counts how many integers k in the interval [2, 4n) divide (n + n%6 - 3)n evenly, i.e., it counts the number of divisors of (n + n%6 - 3)n in the interval [2, 4n). We claim that this count is 2 if and only if n is part of a twin prime pair.

  • If n = 1, the integer (n + n%6 - 3)n = 1 + 1 - 3 = -1 has no divisors in [2, 4).

  • If n = 2, the integer (n + n%6 - 3)n = 2(2 + 2 - 3) = 2 has one divisor (itself) in [2, 8).

  • If n = 3 (a twin prime), the integer (n + n%6 - 3)n = 3(3 + 3 - 3) = 9 has two divisors (3 and 9) in [2, 12).

Python 3, 53 bytes

lambda n:sum((n+n%6-3)*n%k<1for k in range(2,4*n))==2

Try it online!

Background

All integers take one of the following forms, with integer k: 6k - 2, 6k - 1, 6k, 6k + 1, 6k + 2, 6k + 3.

Since 6k - 2, 6k, and 6k + 2 are all even, and since 6k + 3 is divisible by 3, with the exception of 2 and 3, all primes must be of the form 6k - 1 or 6k + 1. Since the difference of a twin prime pair is 2, with the exception of (3, 5), all twin prime pairs are of the form (6k - 1, 6k + 1).

Let n be of the form 6k ± 1.

  • If n = 6k -1, then n + n%6 - 3 = 6k - 1 + (6k - 1)%6 - 3 = 6k - 1 + 5 - 3 = 6k + 1.

  • If n = 6k + 1, then n + n%6 - 3 = 6k + 1 + (6k + 1)%6 - 3 = 6k + 1 + 1 - 3 = 6k - 1.

Thus, if n is part of a twin prime pair and n ≠ 3, it's twin will be n + n%6 - 3.

How it works (WIP)

Python doesn't have a built-in primality test. While there are short-ish ways to test a single number for primality, doing so for two number would be lengthy. We're going to work with divisors instead.

sum((n+n%6-3)*n%k<1for k in range(2,4*n))

counts how many integers k in the interval [2, 4n) divide (n + n%6 - 3)n evenly, i.e., it counts the number of divisors of (n + n%6 - 3)n in the interval [2, 4n). We claim that this count is 2 if and only if n is part of a twin prime pair.

Python 3, 53 bytes

lambda n:sum((n+n%6-3)*n%k<1for k in range(2,4*n))==2

Try it online!

Background

All integers take one of the following forms, with integer k: 6k - 2, 6k - 1, 6k, 6k + 1, 6k + 2, 6k + 3.

Since 6k - 2, 6k, and 6k + 2 are all even, and since 6k + 3 is divisible by 3, with the exception of 2 and 3, all primes must be of the form 6k - 1 or 6k + 1. Since the difference of a twin prime pair is 2, with the exception of (3, 5), all twin prime pairs are of the form (6k - 1, 6k + 1).

Let n be of the form 6k ± 1.

  • If n = 6k -1, then n + n%6 - 3 = 6k - 1 + (6k - 1)%6 - 3 = 6k - 1 + 5 - 3 = 6k + 1.

  • If n = 6k + 1, then n + n%6 - 3 = 6k + 1 + (6k + 1)%6 - 3 = 6k + 1 + 1 - 3 = 6k - 1.

Thus, if n is part of a twin prime pair and n ≠ 3, it's twin will be n + n%6 - 3.

How it works (WIP)

Python doesn't have a built-in primality test. While there are short-ish ways to test a single number for primality, doing so for two number would be lengthy. We're going to work with divisors instead.

sum((n+n%6-3)*n%k<1for k in range(2,4*n))

counts how many integers k in the interval [2, 4n) divide (n + n%6 - 3)n evenly, i.e., it counts the number of divisors of (n + n%6 - 3)n in the interval [2, 4n). We claim that this count is 2 if and only if n is part of a twin prime pair.

  • If n = 1, the integer (n + n%6 - 3)n = 1 + 1 - 3 = -1 has no divisors in [2, 4).

  • If n = 2, the integer (n + n%6 - 3)n = 2(2 + 2 - 3) = 2 has one divisor (itself) in [2, 8).

  • If n = 3 (a twin prime), the integer (n + n%6 - 3)n = 3(3 + 3 - 3) = 9 has two divisors (3 and 9) in [2, 12).

added 1384 characters in body
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825
Loading
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825
Loading