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!)
A087243 a(n) = n + A087242(n) or a(n)=0 if A087242(n)=0; the primes arising as n + A087242(n). 1
3, 5, 5, 7, 7, 11, 0, 11, 11, 13, 13, 17, 0, 17, 17, 19, 19, 23, 0, 23, 23, 29, 0, 29, 0, 29, 29, 31, 31, 37, 0, 37, 0, 37, 37, 41, 0, 41, 41, 43, 43, 47, 0, 47, 47, 53, 0, 53, 0, 53, 53, 59, 0, 59, 0, 59, 59, 61, 61, 67, 0, 67, 0, 67, 67, 71, 0, 71, 71, 73, 73, 79, 0, 79, 0, 79, 79, 83, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
If n is odd, a(n) is either n+2 (if n+2 is prime) or 0; if n is even, a(n) is the least prime p such that p-n is prime. Polignac's conjecture implies that such a prime exists. - Robert Israel, Sep 29 2014
LINKS
FORMULA
a(n) = n+Min{x prime; n+x is prime} or a(n)=0 if Min{} does not exist.
EXAMPLE
a(n)=0, i.e., no solution exists if n is a special prime, namely n is not a lesser twin prime; e.g., if n=7, then neither 7+2=9 nor 7+(oddprime) is a prime, thus no p prime exists such that 7+p is also a prime.
If n is a lesser twin prime then a(n)=2 is a solution because n+a(n) = n+2 = greater twin prime satisfying the condition.
MAPLE
N:= 1000: # to get the first N terms
nToDo:= floor(N/2): OddPrimes[1]:= 3: A[1]:= 3:
for i from 1 to floor(N/2) do A[2*i+1]:= 0 od:
for j from 2 while nToDo > 0 do
OddPrimes[j]:= nextprime(OddPrimes[j-1]);
A[OddPrimes[j]-2]:= OddPrimes[j];
for i from 1 to j-1 do
d:= OddPrimes[j] - OddPrimes[i];
if d <= N and not assigned(A[d]) then
A[d]:= OddPrimes[j];
nToDo:= nToDo-1;
fi
od
od:
seq(A[j], j=1..N); # Robert Israel, Sep 29 2014
PROG
(PARI) a(n) = {if (n % 2, if (isprime(n+2), p = 2, p = 0); , p = 2; while (!isprime(n+p), p = nextprime(p+1)); ); if (p, n + p, 0); } \\ Michel Marcus, Dec 26 2013
CROSSREFS
Cf. A087242.
Sequence in context: A079886 A338363 A346563 * A112276 A079578 A066169
KEYWORD
nonn
AUTHOR
Labos Elemer, Sep 04 2003
EXTENSIONS
Some corrections by Michel Marcus, Dec 26 2013
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 April 18 20:26 EDT 2024. Contains 371781 sequences. (Running on oeis4.)