Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Consecutive integers

  • 27-04-2010 10:50am
    #1
    Moderators, Education Moderators, Regional South Moderators Posts: 15,247 Mod ✭✭✭✭


    Having a bit of a problem with this question
    Show how to write down twelve consecutive integers none of which is a prime number

    My figuring is that its to show 12 composite numbers between 2 primes. Is there a formula for finding a certain gap between two primes? Honestly can't remember doing anything like it in lectures!


Comments

  • Closed Accounts Posts: 6,081 ✭✭✭LeixlipRed


    spent about 15 minutes thinking about this and I think you can do it using the Chinese Remainder Theorem. What I did was took 12 consecutive integers and called the first one a. Then your set C of composite numbers is {a, a+1, a+2,...,a+11}. Then I set a to be even, a+1 to be divisible by 3, a+3 to be divisible by 5 and so on. That means a = 2n and you should end up with a system of congruences in n which you can solve using CRT. Haven't done it out fully though as I should be working!


  • Closed Accounts Posts: 6,081 ✭✭✭LeixlipRed


    I'm not sure that works at all now tbh. Anyway, no time now to check.


  • Registered Users, Registered Users 2 Posts: 13,077 ✭✭✭✭bnt


    Are you allowed to use Wikipedia on this topic? There's a lot of information in the Prime Gap article, including various theorems.

    You are the type of what the age is searching for, and what it is afraid it has found. I am so glad that you have never done anything, never carved a statue, or painted a picture, or produced anything outside of yourself! Life has been your art. You have set yourself to music. Your days are your sonnets.

    ―Oscar Wilde predicting Social Media, in The Picture of Dorian Gray



  • Registered Users, Registered Users 2 Posts: 2,481 ✭✭✭Fremen


    LeixlipRed wrote: »
    I'm not sure that works at all now tbh. Anyway, no time now to check.

    Yeah, that works. Pick any twelve primes, p_1 to p_12 and apply the chinese remainder theorem to solve for x with

    x = -n mod p_n

    then x is the first number in your progression

    Not sure I understood what you meant by a=2n, though


  • Closed Accounts Posts: 6,081 ✭✭✭LeixlipRed


    I just kind of forced it. Let the first number be a multiple of 2, next a multiple of 3, etc, and then you'd find one particular example. It's not the most general method, yours is that.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,481 ✭✭✭Fremen


    Actually, I think you have to modify the construction a little. The argument outlined above only shows that each x+n is divisible by a prime p_n. That means it could actually be p_n itself, which is not what you want.

    If you use p_n squared instead, then you know for sure that each x+n is divisible by the square of a prime, and therefore is composite.

    Of course, you could easily check that by hand with lexlip's method.


  • Registered Users, Registered Users 2 Posts: 107 ✭✭seandoiler


    can you not just use

    (2.3.5.7.11.13)+2,...,(2.3.5.7.11.13)+13

    this will give 12 consecutive numbers with no primes


  • Closed Accounts Posts: 4,204 ✭✭✭FoxT


    One bulletproof way to generate a sequence of n composite integers it to use

    (n+1)! +2, (n+1)!+3, ........(n+1)! +n

    The drawback with this is that (n+1)! gets enormous fast. Also it generally will not give you the lowest-value sequence of n consecutive composites.

    Seandoilers line of reasoning I think is more elegant but I am not sure how to generalise it. Note that (n+1)! + 1 may be a prime. For example 3!+1 = 7.

    Cheers,

    FoxT


  • Closed Accounts Posts: 4,204 ✭✭✭FoxT


    Just re-read the OP..

    "My figuring is that its to show 12 composite numbers between 2 primes"

    if the question is worded exactly as you say, then I would not make that inference at all. There is not afaik a formula for finding the exact gap between 2 primes, though there are formulae that make accurate estimates of prime distribution overall.

    So I think it is sufficient to just find any 12 consecutive composites.

    -Foxt


  • Registered Users, Registered Users 2 Posts: 107 ✭✭seandoiler


    FoxT wrote: »
    Seandoilers line of reasoning I think is more elegant but I am not sure how to generalise it.

    sorry should have qualified my point earlier but was just heading away...in order to generalise then i reckon as follows...

    suppose we want n consecutive composite integers, find the closest prime larger than n let's call it p then proceed as follows
    (2*3*5*...*p)+2,(2*3*5*...*p)+3,...,(2*3*5*...*p)+(n+1)

    this should give the right answer then (i think)


  • Advertisement
  • Closed Accounts Posts: 4,204 ✭✭✭FoxT


    Seandoiler's explanation is spot on - and is more efficient than using (n+1)! as I outlined, because the numbers involved will be smaller. Unfortunately there is no handy function for finding the smallest prime that is greater than a given integer.

    From a computer science point of view - it would be interesting to investigate which method would be more efficient in terms of resource consumption ( memory, CPU cycles, time), but that would be a digression from the OP's question!


  • Closed Accounts Posts: 6,081 ✭✭✭LeixlipRed


    seandoiler wrote: »
    can you not just use

    (2.3.5.7.11.13)+2,...,(2.3.5.7.11.13)+13

    this will give 12 consecutive numbers with no primes

    So simple. I love number theory :)


  • Moderators, Education Moderators, Regional South Moderators Posts: 15,247 Mod ✭✭✭✭rebel girl 15


    Thanks for all the replies - doing Elementary Number Theory in college, love the module but I've found it difficult in parts, just going through exam papers at the moment and that came up! I could be back again 2moro with a few more questions

    Thanks!


  • Registered Users, Registered Users 2 Posts: 338 ✭✭ray giraffe


    seandoiler wrote: »
    sorry should have qualified my point earlier but was just heading away...in order to generalise then i reckon as follows...

    suppose we want n consecutive composite integers, find the closest prime larger than n let's call it p then proceed as follows
    (2*3*5*...*p)+2,(2*3*5*...*p)+3,...,(2*3*5*...*p)+(n+1)

    this should give the right answer then (i think)

    hmm... how small can we make them?

    suppose we want n consecutive composite integers, find the largest prime no larger than n+1 let's call it p then proceed as follows
    (2*3*5*...*p)-2,(2*3*5*...*p)-3,...,(2*3*5*...*p)-(n+1)

    smallest for original question is 114 up to 125


  • Registered Users, Registered Users 2 Posts: 4,798 ✭✭✭goose2005


    114-126 are all composite, but maybe your prof. wanted a fancier solution?


  • Registered Users, Registered Users 2 Posts: 107 ✭✭seandoiler


    hmm... how small can we make them?

    suppose we want n consecutive composite integers, find the largest prime no larger than n+1 let's call it p then proceed as follows
    (2*3*5*...*p)-2,(2*3*5*...*p)-3,...,(2*3*5*...*p)-(n+1)

    smallest for original question is 114 up to 125

    of course this is pretty much equivalent to the + solution but does give a 'lower' set of numbers

    not sure how the 114-125 solution is generated other than by brute force checking but is of course true

    however since the OP said they were doing some form of number theory, then i'd go with either the solution proposed in my original post (or modified with the minus sign proposed by Ray)


Advertisement