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.

This page as a plain text file.
%I A208238 #11 Dec 23 2023 13:56:57
%S A208238 2,2,5,7,17,11,13,23,17,19,41,23,89,29,29,31,67,71,37,79,41,43,89,47,
%T A208238 97,89,53,59,113,59,61,127,131,67,137,71,73,101,307,79,163,83,337,107,
%U A208238 89,109,349,191,97,113,101,103,211,107,109,223,113,229,233,239
%N A208238 Smallest prime greater than n, containing it in binary representation.
%C A208238 a(n) <= A208241(n);
%C A208238 A174332(n) = a(A000040(n)).
%H A208238 Reinhard Zumkeller, <a href="/A208238/b208238.txt">Table of n, a(n) for n = 0..10000</a>
%t A208238 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 *)
%o A208238 (Haskell)
%o A208238 import Data.List (genericIndex, find, isInfixOf)
%o A208238 import Data.Maybe (fromJust)
%o A208238 a208238 = genericIndex a208238_list
%o A208238 a208238_list = f nns $ filter ((== 1) . a010051' . fst) nns where
%o A208238    f mms'@((m,ms):mms) pps'@((p,ps):pps) =
%o A208238      if m == p then f mms' pps else q : f mms pps'
%o A208238      where q = fst $ fromJust $ find ((ms `isInfixOf`) . snd) pps'
%o A208238    nns = zip [0..] a030308_tabf
%Y A208238 Cf. A208241, A004676, A007088, A010051, A030308.
%K A208238 nonn
%O A208238 0,1
%A A208238 _Reinhard Zumkeller_, Feb 14 2013