login
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.
5
2, 4, 9, 8, 27, 24, 25, 54, 51, 22, 117, 222, 49, 114, 87, 46, 207, 216, 121, 258, 291, 128, 591, 336, 203, 306, 423, 136, 519, 492, 221, 888, 951, 146, 537, 318, 527, 1656, 561, 238, 699, 732, 265, 864, 1365, 286, 1353, 1674, 341, 1422, 1671, 802, 2451, 876, 553
OFFSET
0,1
COMMENTS
First appearance of n in A047160.
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
No odd primes are in this sequence. - Lei Zhou, Mar 06 2012
EXAMPLE
a(0)=2 because 2-0 and 2+0 are primes. 2 is the least such value.
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.
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.
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.
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.
MATHEMATICA
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}]
PROG
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
(Haskell)
import Data.List (elemIndex); import Data.Maybe (fromJust)
a103147 = (+ 2) . fromJust . (`elemIndex` a047160_list)
-- Reinhard Zumkeller, Aug 10 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Lei Zhou, Jan 26 2005
EXTENSIONS
Edited by Ray Chandler and T. D. Noe, Feb 01 2005
STATUS
approved