login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Maximal run length of primes of the form n, n+2, n+2*3, n+2*3*5,..
3

%I #13 Jan 04 2019 09:03:56

%S 0,1,2,0,3,0,1,0,0,0,4,0,1,0,0,0,5,0,1,0,0,0,1,0,0,0,0,0,2,0,1,0,0,0,

%T 0,0,1,0,0,0,9,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,2,0,1,0,0,0,0,0,1,0,

%U 0,0,2,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,6,0,1,0,0

%N Maximal run length of primes of the form n, n+2, n+2*3, n+2*3*5,..

%H Antti Karttunen, <a href="/A175663/b175663.txt">Table of n, a(n) for n = 1..16384</a>

%H Antti Karttunen, <a href="/A175663/a175663.txt">Data supplement: n, a(n) computed for n = 1..100000</a>

%F a(n) <= A175682(n). - _Antti Karttunen_, Jan 03 2019

%e a(107)=8 because 107=prime, 107+2=109=prime, 107+2*3=113=prime, 107+2*3*5=137=prime, 107+2*3*5*7=317=prime, 107+2*3*5*7*11=2417=prime, 107+2*3*5*7*11*13=30137=prime, 107+2*3*5*7*11*13*17=510617=prime.

%p A002110 := proc(n) option remember; mul(ithprime(i),i=1..n) ; end proc:

%p A175663 := proc(n) if isprime(n) then for p from 1 do if not isprime(n+A002110(p)) then return p ; end if; end do: else return 0 ; end if; end proc:

%p seq(A175663(n),n=1..120) ; # _R. J. Mathar_, Aug 07 2010

%t Array[If[PrimeQ@ #, Block[{s = {1}}, While[PrimeQ[# + Times @@ Prime@ s], AppendTo[s, s[[-1]] + 1]]; Last@ s], 0] &, 105] (* _Michael De Vlieger_, Jan 03 2019 *)

%o (PARI) A175663(n) = if(!isprime(n),0,my(pr=2); for(k=1, oo, if(!isprime(pr+n), return(k)); pr *= prime(1+k))); \\ _Antti Karttunen_, Jan 03 2019

%Y Cf. A006512 (greater of twin primes), A175612 (list of twin semiprimes), A175648 (lesser of twin semiprimes).

%Y Cf. also A175682.

%K nonn

%O 1,3

%A Vladislav-Stepan Malakovsky & _Juri-Stepan Gerasimov_, Aug 04 2010