login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A175663
Maximal run length of primes of the form n, n+2, n+2*3, n+2*3*5,..
3
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, 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, 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
OFFSET
1,3
FORMULA
a(n) <= A175682(n). - Antti Karttunen, Jan 03 2019
EXAMPLE
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.
MAPLE
A002110 := proc(n) option remember; mul(ithprime(i), i=1..n) ; end proc:
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:
seq(A175663(n), n=1..120) ; # R. J. Mathar, Aug 07 2010
MATHEMATICA
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 *)
PROG
(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
CROSSREFS
Cf. A006512 (greater of twin primes), A175612 (list of twin semiprimes), A175648 (lesser of twin semiprimes).
Cf. also A175682.
Sequence in context: A291044 A113290 A078442 * A240672 A352288 A243016
KEYWORD
nonn
AUTHOR
Vladislav-Stepan Malakovsky & Juri-Stepan Gerasimov, Aug 04 2010
STATUS
approved