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.

A103153 a(n) is the smallest odd prime p such that 2*n+1 = 2*p + A000040(k) for some k>1, or 0 if no such prime exists.

Original entry on oeis.org

0, 0, 0, 3, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 7, 5, 3, 3, 5, 5, 3, 7, 3, 3, 5, 3, 7, 5, 3, 7, 5, 3, 3, 5, 5, 3, 7, 3, 3, 5, 5, 3, 7, 3, 19, 5, 3, 7, 5, 11, 3, 11, 3, 3, 5, 3, 3, 5, 3, 7, 5, 11, 7, 11, 11, 3, 11, 3, 13, 5, 3, 3, 5, 5, 7, 7, 3, 3, 5, 5, 3, 7, 5, 3, 7, 3, 13, 5, 3, 7, 5, 3, 3, 5, 5, 7, 7, 3
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, thus a(4)=3. For n=7, 2*7+1 = 15 = 2*5+5, thus a(7)=7.
		

Crossrefs

a(n)=0 if A103507(n)=0, otherwise A000040(A103507(n)).
Cf. A195352 (similar definition, but p=2 is allowed).

Programs

  • Mathematica
    Do[m = 3; While[ ! (PrimeQ[m] && ((n - 2*m) > 2) && PrimeQ[n - 2*m]), m = m + 2]; Print[m], {n, 9, 299, 2}]
  • Scheme
    (define (A103153 n) (let ((ind (A103507 n))) (if (zero? ind) 0 (A000040 ind))))

Extensions

Edited and Scheme code added by Antti Karttunen, Jun 19 2007
Definition corrected by Hugo Pfoertner, Sep 16 2011