Results 1 to 11 of 11
Like Tree5Thanks
  • 1 Post By SlipEternal
  • 1 Post By SlipEternal
  • 1 Post By SlipEternal
  • 1 Post By SlipEternal
  • 1 Post By SlipEternal

Thread: Prime pattern

  1. #1
    Member
    Joined
    May 2010
    Posts
    135

    Prime pattern

    Can anyone see why this generates Prime?
    Attached Thumbnails Attached Thumbnails Prime pattern-prime.png  
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Nov 2010
    Posts
    3,078
    Thanks
    1176

    Re: Prime pattern

    9!-8!+7!-6!+5!-4!+3!-2!+1!=326981=79*4139

    It was coincidence that terms 3 through 8 produce prime numbers.
    Thanks from rodders
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Member
    Joined
    May 2010
    Posts
    135

    Re: Prime pattern

    thanks...I was getting excited...
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Member
    Joined
    May 2010
    Posts
    135

    Re: Prime pattern

    Do we have a way of summing alternating factorials like this? They look like a fascinating series...
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor
    Joined
    Nov 2010
    Posts
    3,078
    Thanks
    1176

    Re: Prime pattern

    Quote Originally Posted by rodders View Post
    Do we have a way of summing alternating factorials like this? They look like a fascinating series...
    $a_1 = 1!$
    $a_2 = 2!-1!$
    $a_3 = 3!-2!+1! = 3!-(2!-1!) = 3!-a_2$
    $a_4 = 4!-3!+2!-1! = 4!-(3!-(2!-1!)) = 4!-a_3$
    .
    .
    .
    $a_n = n! - a_{n-1}$

    In Wolframalpha, it is the af function. Example:

    http://www.wolframalpha.com/input/?i=af(10)
    Last edited by SlipEternal; Jan 9th 2018 at 11:11 AM.
    Thanks from rodders
    Follow Math Help Forum on Facebook and Google+

  6. #6
    MHF Contributor
    Joined
    Nov 2010
    Posts
    3,078
    Thanks
    1176

    Re: Prime pattern

    This may be what you are looking for:

    Wolfram|Alpha: Computational Knowledge Engine
    Thanks from rodders
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Member
    Joined
    May 2010
    Posts
    135

    Re: Prime pattern

    Quote Originally Posted by SlipEternal View Post
    $a_1 = 1!$
    $a_2 = 2!-1!$
    $a_3 = 3!-2!+1! = 3!-(2!-1!) = 3!-a_2$
    $a_4 = 4!-3!+2!-1! = 4!-(3!-(2!-1!)) = 4!-a_3$
    .
    .
    .
    $a_n = n! - a_{n-1}$

    In Wolframalpha, it is the af function. Example:

    Wolfram|Alpha: Computational Knowledge Engine
    Can this be expressed in closed form or only as a recurrence relation? can't see what the af function is!
    Follow Math Help Forum on Facebook and Google+

  8. #8
    MHF Contributor
    Joined
    Nov 2010
    Posts
    3,078
    Thanks
    1176

    Re: Prime pattern

    Quote Originally Posted by rodders View Post
    Can this be expressed in closed form or only as a recurrence relation? can't see what the af function is!
    There are many ways of representing it. Another way is with the Exponential Integral, the Gamma function, and the Incomplete Gamma Function:

    Wolfram|Alpha: Computational Knowledge Engine

    But, in terms of simple functions, no, it has no closed form.

    To see that the two equations are equal is not easy. Here is the function with n=1 to 10.

    http://www.wolframalpha.com/input/?i...7Bn,1,10%7D%5D
    Last edited by SlipEternal; Jan 9th 2018 at 12:34 PM.
    Thanks from rodders
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Member
    Joined
    May 2010
    Posts
    135

    Re: Prime pattern

    Found an interesting fact about these sum..

    Miodrag Zivković proved in 1999 that there are only a finite number of alternating factorials that are also prime numbers, since 3612703 divides af(3612702) and therefore divides af(n) for all n ≥ 3612702. As of 2006, the known primes and probable primes are af(n) for (sequence A001272 in the OEIS)

    n = 3, 4, 5, 6, 7, 8, 10, 15, 19, 41, 59, 61, 105, 160, 661, 2653, 3069, 3943, 4053, 4998, 8275, 9158, 11164
    Only the values up to n = 661 have been proved prime in 2006. af(661) is approximately 7.818097272875 101578.

    Don't quite get the reasoning why there is a limit to the number of primes though
    Follow Math Help Forum on Facebook and Google+

  10. #10
    MHF Contributor
    Joined
    Nov 2010
    Posts
    3,078
    Thanks
    1176

    Re: Prime pattern

    Reasoning to the limit:
    If 3612703 divides af(n) for all $n\ge 3612702$, then af(n) is a composite number, not a prime number. Therefore, only af(1) through af(3612701) could possibly be prime. To show that af(n) is composite:

    Induction Hypothesis: for all $n\ge 3612702, 3612703$ divides $\text{af}(n)$.
    Base of Induction: for $n=3612702$, Zivković showed that 3612703 divides $\text{af}(n)$. (I do not have the computing power to prove that statement is true, but if it is true, the rest of the induction follows).
    Induction assumption: Suppose 3612703 divides af(n) for some $n\ge 3612702$.
    Then by the induction hypothesis, there exists integer $k$ such that $\text{af}(n) = 3612703k$.
    Next, we want to show that 3612703 divides $\text{af}(n+1) = (n+1)! - \text{af}(n)$. Since $n\ge 3612702$, we know there exists integer $q$ such that $(n+1)! = 3612703q$ (property of the factorial, we know that $q$ is the product of all positive integers no larger than $n+1$ not equal to 3612703).
    So, $\text{af}(n+1) = (n+1)! - \text{af}(n) = 3612703q-3612703k = 3612703(q-k)$.
    Since the difference of two integers (q-k) is an integer, it shows that $\text{af}(n+1)$ is a composite number divisible by 3612703.
    Therefore, by the principle of mathematical induction, the hypothesis holds for all $n\ge 3612702$.

    So, as long as 3712703 really does divide af(3612702), there are only a finite number of primes. I will go ahead and trust Zivković rather than try to prove it myself.
    Thanks from rodders
    Follow Math Help Forum on Facebook and Google+

  11. #11
    MHF Contributor
    Joined
    Nov 2010
    Posts
    3,078
    Thanks
    1176

    Re: Prime pattern

    Actually, I can prove that af(3612702) is divisible by 3612703 with an R program:

    fact <- 1
    af <- 1
    for( i in 2:3612702 ) {
    fact <- (i * fact) %% 3612703
    af <- (fact - af) %% 3612703
    }
    af

    If the final result gives 0, then af(3612702) is divisible by 3612703.
    When I ran the code, it did, in fact, give 0.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 0
    Last Post: Jan 9th 2013, 08:35 PM
  2. Replies: 1
    Last Post: Oct 22nd 2011, 01:37 PM
  3. Replies: 1
    Last Post: Jun 19th 2011, 01:56 PM
  4. Publishing prime pattern - question?
    Posted in the Number Theory Forum
    Replies: 9
    Last Post: Jan 23rd 2011, 03:00 PM
  5. Prime number pattern (and Benford's Law)
    Posted in the Math Forum
    Replies: 0
    Last Post: Jul 3rd 2010, 10:04 AM

/mathhelpforum @mathhelpforum