cp's OEIS Frontend

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.

A103507 a(n) = Least i > 1, such that 2n+1 = 2*A000040(i)+A000040(k) for some k>1, 0 if no such i exists.

Original entry on oeis.org

0, 0, 0, 2, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 4, 3, 2, 2, 3, 3, 2, 4, 2, 2, 3, 2, 4, 3, 2, 4, 3, 2, 2, 3, 3, 2, 4, 2, 2, 3, 3, 2, 4, 2, 8, 3, 2, 4, 3, 5, 2, 5, 2, 2, 3, 2, 2, 3, 2, 4, 3, 5, 4, 5, 5, 2, 5, 2, 6, 3, 2, 2, 3, 3, 4, 4, 2, 2, 3, 3, 2, 4, 3, 2, 4, 2, 6, 3, 2, 4, 3, 2, 2, 3, 3, 4, 4, 2, 2, 3, 2, 2, 3, 3, 4, 4, 5, 2
Offset: 1

Views

Author

Lei Zhou, Feb 09 2005

Keywords

Examples

			For n < 4 there are no such primes, thus a(1)-a(3)=0. For n=4, 2*4+1 = 9 = 2*3+3 and 3=A000040(2), thus a(4)=2. For n=7, 2*7+1 = 15 = 2*5+5 and 5=A000040(3), thus a(7)=3.
		

Crossrefs

a(n) = A049084(A103153(n)), for n >= 4. Can be used to compute A103153 and A103508. Cf. A103509.

Programs

  • Mathematica
    Do[m = 3; While[ ! (PrimeQ[m] && ((n - 2*m) > 2) && PrimeQ[n - 2*m]), m = m + 2]; k = PrimePi[m]; Print[k], {n, 9, 299, 2}]

Extensions

Edited, Scheme-code added and starting offset changed from 0 to 1 by Antti Karttunen, Jun 19 2007