OFFSET
1,4
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
Antti Karttunen, Data supplement: n, a(n) computed for n = 1..65539
EXAMPLE
MATHEMATICA
Do[m = 3; While[ ! (PrimeQ[m] && (((n - m)/2) > 2) && PrimeQ[(n - m)/2]), m = m + 2]; k = PrimePi[m]; Print[k], {n, 9, 299, 2}]
PROG
(Scheme, with Aubrey Jaffer's SLIB Scheme library from http://www.swiss.ai.mit.edu/~jaffer/SLIB.html )
(define (A103509 n) (let ((o (+ (* 2 n) 1))) (let loop ((i 2)) (let ((p2 (A000040 i))) (cond ((> p2 (- o 6)) 0) ((prime? (/ (- o p2) 2)) i) (else (loop (+ 1 i)))))))) -- Antti Karttunen, Jun 19 2007
(PARI) A103509(n) = if(n<=3, 0, my(o=n+n+1); for(i=2, oo, if(isprime((o-prime(i))/2), return(i)))); \\ Antti Karttunen, Mar 30 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Lei Zhou, Feb 10 2005
EXTENSIONS
Edited by Antti Karttunen, Jun 19 2007
STATUS
approved