login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
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
LINKS
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
Sequence in context: A129598 A256017 A125752 * A340169 A079781 A163299
KEYWORD
nonn
AUTHOR
Lei Zhou, Jan 26 2005
EXTENSIONS
Edited by Ray Chandler and T. D. Noe, Feb 01 2005
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 18:04 EDT 2024. Contains 371254 sequences. (Running on oeis4.)