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.

A103147 Least k such that k+n and k-n are both prime but k-m and k+m are not both prime for any 0 <= m < n.

This page as a plain text file.
%I A103147 #27 Dec 25 2016 00:50:57
%S A103147 2,4,9,8,27,24,25,54,51,22,117,222,49,114,87,46,207,216,121,258,291,
%T A103147 128,591,336,203,306,423,136,519,492,221,888,951,146,537,318,527,1656,
%U A103147 561,238,699,732,265,864,1365,286,1353,1674,341,1422,1671,802,2451,876,553
%N A103147 Least k such that k+n and k-n are both prime but k-m and k+m are not both prime for any 0 <= m < n.
%C A103147 First appearance of n in A047160.
%C A103147 It appears that a(3n) is less than a(3n-1) and a(3n+1) for all n except 2 and 12. The lower and upper primes are A155766(n) and A155767(n). - _T. D. Noe_, Jan 26 2009
%C A103147 No odd primes are in this sequence. - _Lei Zhou_, Mar 06 2012
%H A103147 T. D. Noe, <a href="/A103147/b103147.txt">Table of n, a(n) for n = 0..2000</a>
%H A103147 <a href="/index/Go#Goldbach">Index entries for sequences related to Goldbach conjecture</a>
%e A103147 a(0)=2 because 2-0 and 2+0 are primes. 2 is the least such value.
%e A103147 a(1)=4 because 4-1 and 4+1 are prime, but 4-0 and 4-0 are not prime. 4 is the least such value.
%e A103147 a(2)=9 because 9-2 and 9+2 are prime, but (8,10) and (9,9) are not prime pairs. 9 is the least such value.
%e A103147 a(3)=8 because 8-3 and 8+3 are prime, but (6,10), (7,9) and (8,8) are not prime pairs. 8 is the least such value.
%e A103147 a(11)=222 because 211 and 233 are prime, but (222-m,222+m) is not a prime pair for any m<11. 222 is the least such value.
%t A103147 primePairQ[k_, n_] := PrimeQ[k+n]&&PrimeQ[k-n]; SetAttributes[primePairQ, Listable]; Table[k=n+2; While[ !primePairQ[k, n] || (Or@@primePairQ[k, Range[0, n-1]]), k++ ]; k, {n, 0, 55}]
%o A103147 g(1) = 0; for i = 2:100001 if isprime(i) g(i) = 0; else g(i) = 1; while not(isprime(i - g(i)) & isprime(i + g(i))) g(i) = g(i) + 1; end end end f = g - g; for i = 2:100001 if g(i) > 0 if f(g(i)) == 0 f(g(i)) = i; end end end
%o A103147 (Haskell)
%o A103147 import Data.List (elemIndex); import Data.Maybe (fromJust)
%o A103147 a103147 = (+ 2) . fromJust . (`elemIndex` a047160_list)
%o A103147 -- _Reinhard Zumkeller_, Aug 10 2014
%Y A103147 Cf. A047160, A104883, A107926.
%K A103147 nonn
%O A103147 0,1
%A A103147 _Lei Zhou_, Jan 26 2005
%E A103147 Edited by _Ray Chandler_ and _T. D. Noe_, Feb 01 2005