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.

A185154 Smallest prime p such that a nonconsecutive prime q exists with A157996(n) = p + q + 1.

Original entry on oeis.org

3, 3, 5, 3, 5, 7, 5, 3, 5, 3, 5, 5, 7, 5, 3, 5, 5, 3, 5, 7, 3, 5, 3, 5, 3, 13, 3, 5, 7, 11, 11, 5, 5, 3, 5, 5, 7, 11, 11, 3, 5, 11, 11, 3, 5, 3, 5, 7, 11, 5, 5, 5, 7, 5, 3, 5, 11, 13, 3, 5, 3, 13, 5, 29, 11, 3, 5, 7, 5, 5, 3, 5, 7, 3, 7, 17, 11, 11, 11, 5, 3
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 12 2012

Keywords

Comments

A010051(A157996(n) - a(n) - 1) = 1.

Crossrefs

Programs

  • Haskell
    import Data.Maybe (catMaybes)
    a185154 n = a185154_list !! (n-1)
    a185154_list = catMaybes $ map f a006093_list where
       f x = g $ takeWhile (< x) a065091_list where
         g []  = Nothing
         g [_] = Nothing
         g (p:ps@(_:qs)) | (x - p) `elem` qs = Just p
                         | otherwise         = g ps