# Next number in the sequence 2 3 5 7 11 13 17 20 23 29 33

1. Jul 4, 2012

### axelmorack

I have always been curious about the distance between prime numbers. I call the sequence above the frog numbers because I don't know what else to call them. They are generated from the first n odd primes. How many consecutive integers are divisible by at least one of the set. Then add 1. For example, only one consecutive number is divisible by 3. Add 1 and you get 2. Only 2 consecutive numbers can be divisible by 3 or 5. Add 1 and you get 3. Etc. I don't have the mathematical horsepower to analyze the sequence and I am wondering if someone can give me more information on it? Is there efficient algorithm for generating lots of these numbers? I did write a program to generate the frog numbers in the title above. It is interesting how closely they track the primes.

2. Jul 4, 2012

### Dickfore

So, regarding the second element of the sequence:
$$x = 3 k, x + 1 = 5 l, \ x = 5 m, x + 1 = 3 n$$
These equations are equivalent to the Diophantine equations:
$$5 l - 3 k = 1, \ 3 n - 5 m = 1$$
which have the following general solutions:
$$k = 5 r - 2, l = 3 r - 1 \Rightarrow x = 3 k = 15 k - 6$$
or
$$m = 3 r + 1, n = 5 r + 3 \Rightarrow x = 5 m = 15 m + 5$$
So, we have an infinite family of numbers:
$$x = 15 r + 5, \ x = 15 r + 9, \ r \ge 0$$
that are either divisible by 3 or 5 and their successor is divisible by the other one:

(5, 6), (9, 10), (20, 21), (24, 25), (35, 36), (39, 40), ...

So, I don't understand how you got the second term in your sequence.

3. Jul 4, 2012

### haruspex

The OP is looking at the max length of a consecutive sequence, 2 in your example.

4. Jul 4, 2012

5. Jul 4, 2012

### Dickfore

Oh, so there are no 3 consecutive numbers divisible by 3 or 5.

6. Jul 4, 2012

### axelmorack

You are correct.

7. Jul 4, 2012

### haruspex

It's quite subtle. In 8 consecutive integers, 3 could be divisible by 3, 2 by 5, 2 by 7, 1 by 11; 3+2+2+1=8. Yet you can't achieve a string of 8 using 3 to 11 because the end two would have to be each divisible by 7, and to fit 3 multiples of 3 in, one of them is going to land on one of the 7s. So you can't separate all 8 contributions.

8. Jul 5, 2012

### axelmorack

If you go out on the number line to find the best starting spot for 3,5,7 and 11, that number will be relatively prime to 3,5,7 and 11. It will be of the form (3K+r1), (5K+r2), (7K+r3), and (11K+r4). It is relatively easy to think of starting from 0 and crossing out numbers of the form (3K+s1), (5K+s2), (7k+s3) and (11k+s4) . Then look at the distance from 0 to the first number not of any of these forms. Pick the biggest distance found.

9. Jul 5, 2012

### phillip1882

len+1 | sequence
2 | 3
3 | 3 5
5 | 3 7 5 3
7 | 5 3 7 11 3 5
11 | 3 7 5 3 13 11 3 5 7 3
13 | 11 3 7 5 3 13 17 3 5 7 3 11
17 | 3 13 11 3 7 5 3 19 17 3 5 7 3 11 13 3
19? | 17 3 13 11 3 7 5 3 19 23 3 5 7 3 11 13 3 17
23 | 3 19 17 3 13 11 3 7 5 3 29 23 3 5 7 3 11 13 3 17 19 3
29 | 3 5 23 3 19 17 3 13 11 3 7 5 3 29 31 3 5 7 3 11 13 3 17 19 3 23 5 3
31? | 29 3 5 23 3 19 17 3 13 11 3 7 5 3 37 31 3 5 7 3 11 13 3 17 19 3 23 5 3 29
37?? | 5 3 31 29 3 5 23 3 19 17 3 13 11 3 7 5 3 37 41 3 5 7 3 11 13 3 17 19 3 23 5 3 29 31 3 5

this would be my sequences, not sure how your getting more.

10. Jul 5, 2012

### axelmorack

19 | 3 5 11 3 13 23 3 7 19 3 17 5 3 11 7 3 5 13 3 yields 20

11. Jul 5, 2012

### axelmorack

I'm thinking that as you go to larger primes that the sequences keep coming back to the pattern you describe above but keep veering off from time to time. It is so computationally intense it will be hard to check.