The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A126938 a(1) = 3, a(n) = the smallest prime p > a(n-1) such that (a(n-1)+p)/2 is prime. 5
3, 7, 19, 43, 79, 127, 151, 163, 199, 223, 331, 367, 379, 439, 487, 607, 619, 643, 739, 883, 991, 1051, 1087, 1171, 1231, 1327, 1471, 1627, 1699, 1747, 1759, 1987, 1999, 2179, 2383, 2551, 2683, 2731, 2767, 3067, 3259, 3343, 3571, 3643, 3739, 3847, 3907 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Starting with a(2)=7 all terms are 7 mod 12. - Zak Seidov, Feb 26 2017
LINKS
EXAMPLE
(3+7)/2=5 prime, (7+19)/2=13 prime, (19+43)/2=31 prime, etc.
MAPLE
A[1]:= 3: A[2]:= 7:
for n from 3 to 100 do A[n]:= f(A[n-1]) od:
seq(A[i], i=1..100); # Robert Israel, Feb 27 2017
MATHEMATICA
s={3}; pn=3; n=PrimePi[pn]; Do[Do[p=Prime[i]; If[PrimeQ[(pn+p)/2], AppendTo[s, p]; pn=p; n=i; Break[]], {i, n+1, 10000}], {112}]; s
sp[n_]:=Module[{p=NextPrime[n]}, While[!PrimeQ[(n+p)/2], p=NextPrime[p]]; p]; NestList[sp, 3, 50] (* Harvey P. Dale, Apr 12 2013 *)
PROG
(PARI) step(q)=forprime(p=q+1, , if(isprime((p+q)/2), return(p)))
first(n)=my(v=vector(n)); v[1]=3; for(k=2, n, v[k]=step(v[k-1])); v \\ Charles R Greathouse IV, Feb 27 2017
CROSSREFS
Sequence in context: A086519 A090689 A145476 * A127990 A192301 A350249
KEYWORD
nonn
AUTHOR
Zak Seidov, Mar 18 2007
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 19 23:42 EDT 2024. Contains 372703 sequences. (Running on oeis4.)