Neat little thing (prime numbers finder)

  • Context: High School 
  • Thread starter Thread starter shadowboy13
  • Start date Start date
  • Tags Tags
    Numbers
Click For Summary

Discussion Overview

The discussion revolves around the properties of Egyptian fractions, particularly focusing on the outcomes of adding three such fractions with a constant numerator of 1. Participants explore whether the resulting numerator, after reduction, tends to be a prime number and the implications of this observation.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes a method of adding Egyptian fractions with a numerator of 1 and claims that the resulting numerator is often a prime number, specifically when using three different fractions.
  • Another participant seeks clarification on whether the claim applies to any three Egyptian fractions or only specific cases.
  • A participant shares results from a JavaScript program that shows a prevalence of prime numbers but acknowledges that not all results are prime, citing specific examples of non-prime outcomes.
  • Another participant points out that one of the claimed non-prime results (49) is indeed non-prime, suggesting that the method does not guarantee a prime numerator.
  • One participant proposes that the numerator may not be divisible by any prime factors of the denominators, which could lead to a higher occurrence of primes among smaller integers.
  • A participant shares results from a Scheme program that calculates the numerators for a large range of Egyptian fractions, concluding that a significant percentage of the results are non-prime, yet still noting a higher occurrence of primes than expected.

Areas of Agreement / Disagreement

Participants express differing views on the reliability of the claim regarding prime numerators. While some acknowledge the interesting trend of primes, others challenge the validity of the claim and highlight the presence of non-prime results, indicating that the discussion remains unresolved.

Contextual Notes

The discussion includes various assumptions about the behavior of numerators in relation to their denominators, and the results depend on the specific fractions chosen. There are also unresolved mathematical steps regarding the generalization of the findings.

shadowboy13
Messages
20
Reaction score
0
So i was messing around with egyptian fractions and i eventually decided to try adding them together and then reducing the one single fraction that formed into its lowest terms.

Anyway i set them up with having 1 in the numerator ALWAYS (or else it won't work) and proceeded to add them up.

Surprisingly enough after adding them up and reducing them to their lowest terms i would always get 2 interesting things, the LCM of the various numbers in the denominator and a prime number in the numerator.

Note: This has only worked when i had 3 different fractions (again with 1 as the numerator), when i had 2 or 4 this method failed.

Anyways try it out, maybe someone with more expertise may know something (i'm just a kid :))

(Try out say 1/2 + 1/3 +1/4 and and see for yourself).
 
Mathematics news on Phys.org
Sorry but could you be more specific, what exactly is it that you claim?

Is it that if you add three Egyptian fractions then you get the result? Any three? Like

\frac{1}{m}+\frac{1}{n} + \frac{1}{k} = \frac{p}{\text{LCM}(m,n,k)}

with the numerator ##p## a prime. Or does it only work for subsequent fractions? Or what is it exactly?
 
It does produce a lot of prime numbers, but it does not always produce a prime.

Javascript:
Code:
var i, j, k, num, den, red;

var gcd = function(a,b) {
    return b ? gcd(b,a%b) : a;
};

for(i = 1; i < 8; i++) {
    for(j = i+1; j < 9; j++) {
        for(k = j + 1; k < 10; k++) {
            num = i*j + i*k + j*k;
            den = i*j*k;
            red = num/gcd(num,den);
            console.log(i + ', ' + j + ', ' + k + ': ' + red);
        }
    }
}

Results:

(denominator 1, denominator 2, denominator 3, reduced numerator)

1, 2, 3: 11
1, 2, 4: 7
1, 2, 5: 17
1, 2, 6: 5
1, 2, 7: 23
1, 2, 8: 13
1, 2, 9: 29
1, 3, 4: 19
1, 3, 5: 23
1, 3, 6: 3
1, 3, 7: 31
1, 3, 8: 35
1, 3, 9: 13
1, 4, 5: 29
1, 4, 6: 17
1, 4, 7: 39
1, 4, 8: 11
1, 4, 9: 49 /* Bolded after Matterwave pointed this one out */
1, 5, 6: 41
1, 5, 7: 47
1, 5, 8: 53
1, 5, 9: 59
1, 6, 7: 55
1, 6, 8: 31
1, 6, 9: 23
1, 7, 8: 71
1, 7, 9: 79
1, 8, 9: 89
2, 3, 4: 13
2, 3, 5: 31
2, 3, 6: 1
2, 3, 7: 41
2, 3, 8: 23
2, 3, 9: 17

... and so on. Bolded results are nonprime results that immediately appear to me. Others are probably nonprime but I feel too lazy right now to check them.

The prevalence of primes is interesting. My gut tells me that it probably decreases considerably as the denominators get larger, though.
 
Last edited:
1, 4, 9: 49 is non-prime (7x7)
 
  • Like
Likes   Reactions: 1 person
I just posted this because it is interesting given the percentage of primes vs non primes that you can get.

Maybe there's something to this?
 
Isn't it that the numerator is guaranteed to be not divisible by any prime factors of m, n, k,? That would typically remove small primes leaving only a product of larger ones, for small integers it can give an impression that numerator is often a prime number.
 
I ran the following code on Scheme:

Code:
#lang racket
(require math)

(define (fraction n)
  (define Counter 0)
  (define NotPrimeCounter 0)
  (define mx 0)
  (define (iter a b c)
    (set! Counter (+ Counter 1))
    (define x (* (lcm a b c) (+ (/ 1 a) (/ 1 b) (/ 1 c))))
    (cond [(> x mx) (set! mx x)])
    (cond [(not (prime? x)) 
          ; (fprintf (current-output-port) "~a ~a ~a ~a \n" a b c x)
           (set! NotPrimeCounter (+ NotPrimeCounter 1))])
    (cond [(> c 1) (iter a b (- c 1))]
          [(> b 1) (iter a (- b 1) (- b 1))]
          [(> a 1) (iter (- a 1) (- a 1) (- a 1))]))
  (iter n n n)
  (fprintf (current-output-port) "~a ~a ~a" Counter NotPrimeCounter mx))

(fraction 400)

This calculates all the numerators of ##\frac{1}{a} +\frac{1}{b} + \frac{1}{c}## for ##1\leq a,b,c\leq 400##.

The result was that we obtained ##10,746,800## number. Of these, we had ##7,637,688## not prime. So less than ##30\%## of the numbers are nonprime. The largest number we obtained by was ##476,803##.

To compare, let us choose at random ##10,746,800## numbers between ##1## and ##476,803##, and let us contain how many primes to expect.

The number of primes between ##1## and ##476,800## is by the prime number theorem http://en.wikipedia.org/wiki/Prime_number_theorem about ##\frac{476803}{\text{log}(476803)}## (logarithm always basis ##e##). This is about ##36,000##. So if we select a random number below ##476,803##, then the probability of this number being prime is ##\frac{36000}{476803} \sim 0.07##.

Now, if we select ##10,746,800## numbers at random between ##1## and ##476,803##, then we would expect about ##7\%## primes. So we expect to have about ##750,000## primes. We have now obtained over ##2,500,000## primes, which is about ##25\%##. So we do have a lot of primes compared to my back-of-the-envelope calculation. This could be because my calculation selected numbers at random between ##1## and ##476,803##. But in my program, it is clear that not all of these numbers are as likely. Or it could be that it does yield disproportionally many primes.
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 24 ·
Replies
24
Views
3K
  • · Replies 6 ·
Replies
6
Views
905
  • · Replies 48 ·
2
Replies
48
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K