login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A175682 Maximal run length of positive primes of the form ..., n-2*3*5, n-2*3, n-2, n, n+2, n+2*3, n+2*3*5, ... 3
0, 1, 2, 0, 4, 0, 2, 0, 0, 0, 4, 0, 3, 0, 0, 0, 5, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 9, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 4, 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, 4, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

LINKS

Antti Karttunen, Table of n, a(n) for n = 1..16384

Antti Karttunen, Data supplement: n, a(n) computed for n = 1..100000

FORMULA

a(n) >= A175663(n). - Antti Karttunen, Jan 03 2019

EXAMPLE

For n=5, there is a run of primes from 5-A002110(1) to 5+A002110(2): [3, 5, 7, 11] (while 5-A002110(2) = 5-6 = -1 and 5+A002110(3) = 5+30 = 35 are not primes), thus a(5) = 4. - Antti Karttunen, Jan 03 2019

MATHEMATICA

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

PROG

(PARI) A175682(n) = if(!isprime(n), 0, my(pr=2, dn=1, dp=1, rl=1); for(k=1, oo, if(!isprime(n-pr), dn=0); if(!isprime(n+pr), dp=0); if(!(dn+dp), return(rl)); rl += (dn+dp); pr *= prime(1+k))); \\ (Note that isprime in Pari/GP 2.9.4 returns 0 on all negative arguments) - Antti Karttunen, Jan 03 2019

CROSSREFS

Cf. A002110, A175663.

Sequence in context: A051517 A289359 A053118 * A326722 A279228 A181481

Adjacent sequences:  A175679 A175680 A175681 * A175683 A175684 A175685

KEYWORD

nonn

AUTHOR

Vladislav-Stepan Malakovsky and Juri-Stepan Gerasimov, Aug 08 2010

EXTENSIONS

Terms a(5), a(7) and a(19) corrected by Antti Karttunen, Jan 03 2019

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 24 09:52 EDT 2021. Contains 346273 sequences. (Running on oeis4.)