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!)
A248738 Least number m such that both m^2 -/+ prime(n) are (positive) primes. 1
3, 4, 6, 6, 90, 4, 6, 30, 6, 180, 6, 12, 30, 18, 12, 48, 60, 90, 24, 30, 18, 120, 12, 510, 10, 60, 36, 12, 60, 12, 12, 30, 12, 12, 30, 120, 24, 48, 18, 48, 690, 1020, 30, 14, 18, 420, 180, 18, 36, 540, 42, 1230, 150, 870, 36, 18, 330, 870, 18, 30, 18, 18, 18, 150, 30, 18, 30, 30, 60, 180, 24, 30, 36 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
a(1)=3 because p=prime(1)=2 and both P=3^2-2=7 and Q=3^2+2=11 are prime;
a(3)=6 because p=5 and both P=31 and Q=41 are prime;
a(10000)=510 because p=104729 and both P=155371 and Q=364829 are prime.
MATHEMATICA
lnm[n_]:=Module[{m=2, pr=Prime[n]}, If[m^2-pr<0, m=Ceiling[Sqrt[pr]]]; While[ !AllTrue[m^2+{pr, -pr}, PrimeQ], m++]; m]; Array[lnm, 80] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 22 2014 *)
PROG
(PARI) a(n) = { p = prime(n); m = sqrtint(p); until( isprime(m^2-p) && isprime(m^2+p), m++); m} \\ Michel Marcus, Oct 13 2014
CROSSREFS
Sequence in context: A065967 A345209 A117986 * A070737 A225647 A135599
KEYWORD
nonn
AUTHOR
Zak Seidov, Oct 13 2014
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 14 23:22 EDT 2024. Contains 372535 sequences. (Running on oeis4.)