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.

A208238 Smallest prime greater than n, containing it in binary representation.

Original entry on oeis.org

2, 2, 5, 7, 17, 11, 13, 23, 17, 19, 41, 23, 89, 29, 29, 31, 67, 71, 37, 79, 41, 43, 89, 47, 97, 89, 53, 59, 113, 59, 61, 127, 131, 67, 137, 71, 73, 101, 307, 79, 163, 83, 337, 107, 89, 109, 349, 191, 97, 113, 101, 103, 211, 107, 109, 223, 113, 229, 233, 239
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 14 2013

Keywords

Comments

a(n) <= A208241(n);
A174332(n) = a(A000040(n)).

Crossrefs

Programs

  • Haskell
    import Data.List (genericIndex, find, isInfixOf)
    import Data.Maybe (fromJust)
    a208238 = genericIndex a208238_list
    a208238_list = f nns $ filter ((== 1) . a010051' . fst) nns where
       f mms'@((m,ms):mms) pps'@((p,ps):pps) =
         if m == p then f mms' pps else q : f mms pps'
         where q = fst $ fromJust $ find ((ms `isInfixOf`) . snd) pps'
       nns = zip [0..] a030308_tabf
  • Mathematica
    spgn[n_]:=Module[{idn2=IntegerDigits[n,2],p=NextPrime[n]},While[SequenceCount[ IntegerDigits[ p,2],idn2] == 0,p = NextPrime[p]];p]; Array[spgn,60,0] (* Harvey P. Dale, Dec 23 2023 *)