This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A103509 #15 Mar 30 2021 18:48:09 %S A103509 0,0,0,2,3,2,3,2,3,4,6,2,3,2,3,4,6,2,3,2,3,4,6,2,3,4,7,5,6,2,3,2,3,4, %T A103509 6,5,6,2,3,4,12,2,3,2,3,4,6,2,3,4,7,5,6,2,3,4,10,5,6,2,3,2,3,4,6,5,6, %U A103509 2,3,4,12,2,3,2,3,4,6,5,6,2,3,4,18,2,3,4,7,5,6,2,3,4,10,5,6,15,7,2,3,4,12,2,3,2,3 %N A103509 a(n) is the least j such that 2n+1 = 2*A000040(k) + A000040(j) for some k > 1, or 0 if no such j exists. %H A103509 Antti Karttunen, <a href="/A103509/b103509.txt">Table of n, a(n) for n = 1..16384</a> %H A103509 Antti Karttunen, <a href="/A103509/a103509.txt">Data supplement: n, a(n) computed for n = 1..65539</a> %F A103509 a(n) = A049084(A103506(n)), for n >= 4. %e A103509 For n < 4 there are no such primes, thus a(1)=a(2)=a(3)=0. %e A103509 For n=4, 2*4+1 = 9 = 2*3+3 and 3=A000040(2), thus a(4)=2. %e A103509 For n=11, 2*11+1 = 23 = 13+2*5 and 13=A000040(6), thus a(11)=6. %t A103509 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}] %o A103509 (Scheme, with Aubrey Jaffer's SLIB Scheme library from http://www.swiss.ai.mit.edu/~jaffer/SLIB.html ) %o A103509 (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 %o A103509 (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 %Y A103509 Cf. A049084, A103506. %Y A103509 Can be used to compute A103506 and A103510. Cf. A103507. %K A103509 nonn %O A103509 1,4 %A A103509 _Lei Zhou_, Feb 10 2005 %E A103509 Edited by _Antti Karttunen_, Jun 19 2007