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!)
A187866 Greatest k such that prime(n)*(prime(n)-k)-1 and prime(n)*(prime(n)-k)+1 are twin primes, k >= 0 and k < prime(n) or -1 if no such k exists. 1
0, 1, -1, 1, -1, -1, 11, 7, 17, 17, -1, -1, 11, 19, 41, -1, 41, -1, 43, 53, -1, -1, 29, 41, -1, 59, 97, 101, 61, 89, -1, 101, 131, 127, 137, 73, 133, 127, 137, 119, 47, 163, 101, 157, 131 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,7
COMMENTS
Conjectures:
1. There are only 11 primes such that k does not exist: 5, 11, 13, 31, 37, 53, 61, 73, 79, 97, 127 (same as A183563).
2. There are only 20 primes such that k(n) = A187563(n): 2, 3, 7, 17, 19, 23, 41, 47, 59, 89, 103, 149, 167, 173, 179, 191, 277, 353, 433, 727.
3. If prime(n) >= 3 there are always at least 2 pairs of twin primes between prime(n) and prime(n)^2.
LINKS
MATHEMATICA
a[n_] := (k=Prime[n]-1; While[p = Prime[n]*(Prime[n]-k)-1; k>=0 && !(PrimeQ[p] && PrimeQ[p + 2]), k--]; k); a /@ Range[45] (* Jean-François Alcover, Mar 28 2011 *)
PROG
(PFGW SCRIPTIFY)
SCRIPT
DIM nn, 1
DIM kk
DIMS tt
OPENFILEOUT out, twin
LABEL loopn
SET nn, nn+1
IF nn>25000 THEN END
SET kk, p(nn)
LABEL loopk
SET kk, kk-2
IF kk==-1 THEN GOTO c
SETS tt, %d, %d, %d\,; nn; p(nn); kk
PRP p(nn)*(p(nn)-kk)-1, tt
IF ISPRIME THEN GOTO a
GOTO loopk
LABEL a
PRP p(nn)*(p(nn)-kk)+1, tt
IF ISPRIME THEN GOTO b
GOTO loopk
LABEL b
WRITE out, tt
GOTO loopn
LABEL c
SET kk, -1
SETS tt, %d, %d, %d\,; nn; p(nn); kk
WRITE out, tt
GOTO loopn
CROSSREFS
Cf. A187563.
Sequence in context: A187563 A089487 A166521 * A206419 A250032 A305447
KEYWORD
sign
AUTHOR
Pierre CAMI, Mar 14 2011
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 2 11:52 EDT 2024. Contains 372196 sequences. (Running on oeis4.)