Problems & Puzzles: Puzzles

Puzzle 449. Count N composites after p

J. M. Bergot sent the following puzzle:

For  N a prime, count N composites after it and add 1.

For 5 we  move forward five composites 6, 8, 9, 10, 12 and now add 1 to get 13, also a prime.

For 13 we move forward 13 composites: 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30 and add one to get 31, also a prime.

So this chain is just a two terms one (5, 13).

Q. Are there long chains of primes produced in this manner?

 

Contribution came from Farideh Firoozbakht.

***

Farideh wrote:

The chain started at p=5 is (5, 13, 31). Because the
set of 31 composite numbers after 31 is {32, 33, 34,
35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51,
52, 54, 55, 56, 57, 58, 60, 62, 63, 64, 65, 66, 68,
69, 70} and 70+1 is prime.

The length of the largest chain of such primes that I found is 5
and the chain is (250969, 523129, 1087781, 2257319, 4675397).

For finding solution of this puzzle, I defined a function g
by using the recursive sequence: a(0)=p; a(1)=(2p);
a(n)=a(n-1)+pi(a(n-1))-pi(a(n-2)) and g(p)=1+last term of the
sequence {a(n)}.

Note that if for a natural number m, a(m)=a(m+1) then for all n
n>m, a(n)=a(m). So we can say for each prime p the related sequence
is finite.

For example if p=5 then a(0)=5, a(1)=10, a(2)=10+pi(10)-pi(5)=11,
a(3)=11+pi(11)-pi(10)=12, a(4)=12+pi(12)-pi(11)=12 so g(5)=1+12=13.

And if p=13 then a(0)=13, a(1)=26, a(2)=26+pi(26)-pi(13)=29,
a(3)=29+pi(29)-pi(26)=30, a(4)=30+pi(30)-pi(29)=30 so g(13)=1+30=31.

By defining g in this way we can increase the speed of the computations.

***

Records   |  Conjectures  |  Problems  |  Puzzles