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.

Original entry on oeis.org

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

Views

Author

Lei Zhou, Jan 26 2005

Keywords

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

Examples

			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.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a103147 = (+ 2) . fromJust . (`elemIndex` a047160_list)
    -- Reinhard Zumkeller, Aug 10 2014
  • 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}]

Extensions

Edited by Ray Chandler and T. D. Noe, Feb 01 2005