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.

A103506 Smallest prime p such that 2n+1 = 2q + p for some odd prime q, or 0 if no such prime exists.

This page as a plain text file.
%I A103506 #27 Jan 29 2025 19:37:11
%S A103506 0,0,0,3,5,3,5,3,5,7,13,3,5,3,5,7,13,3,5,3,5,7,13,3,5,7,17,11,13,3,5,
%T A103506 3,5,7,13,11,13,3,5,7,37,3,5,3,5,7,13,3,5,7,17,11,13,3,5,7,29,11,13,3,
%U A103506 5,3,5,7,13,11,13,3,5,7,37,3,5,3,5,7,13,11
%N A103506 Smallest prime p such that 2n+1 = 2q + p for some odd prime q, or 0 if no such prime exists.
%H A103506 Hugo Pfoertner, <a href="/A103506/b103506.txt">Table of n, a(n) for n = 1..10000</a>
%e A103506 For n < 4 there are no such primes, thus a(1)-a(3)=0.
%e A103506 For n=4, 2*4+1 = 9 = 2*3+3, thus a(4)=3.
%e A103506 For n=11, 2*11+1 = 23 = 2*5+13, thus a(11)=13.
%t A103506 Join[{0,0,0}, Table[m=3; While[! (PrimeQ[m] && (((n-m)/2) > 2) && PrimeQ[(n-m)/2]), m=m+2]; m, {n, 9, 299, 2}]]
%o A103506 (Scheme) (define (A103506 n) (let ((ind (A103509 n))) (if (zero? ind) 0 (A000040 ind)))) ;; _Antti Karttunen_, Jun 19 2007
%Y A103506 a(n)=0 if A103509(n)=0, otherwise A000040(A103509(n)).
%Y A103506 Cf. A103151, A103152, A103153.
%K A103506 nonn
%O A103506 1,4
%A A103506 _Lei Zhou_, Feb 09 2005
%E A103506 Edited by _Antti Karttunen_, Jun 19 2007