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.

Showing 1-3 of 3 results.

A004676 Primes written in base 2.

Original entry on oeis.org

10, 11, 101, 111, 1011, 1101, 10001, 10011, 10111, 11101, 11111, 100101, 101001, 101011, 101111, 110101, 111011, 111101, 1000011, 1000111, 1001001, 1001111, 1010011, 1011001, 1100001, 1100101, 1100111, 1101011, 1101101, 1110001, 1111111, 10000011, 10001001
Offset: 1

Views

Author

Keywords

Comments

The only primes of binary weight 2 are the Fermat primes (only five are known: 11, 101, 10001, 100000001, 10000000000000001); the repunits base 2 are the Mersenne primes. - Daniel Forgues, Nov 07 2011

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 3.

Crossrefs

Cf. A019434 Fermat primes (base 10), A000668 Mersenne primes (base 10).

Programs

Formula

a(n) = A007088(A000040(n)). - R. J. Mathar, Jun 03 2011

A208241 Smallest prime greater than n, with n as prefix in binary representation.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Feb 14 2013

Keywords

Comments

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

Crossrefs

Cf. A164022 (greater or equal).

Programs

  • Haskell
    import Data.List (genericIndex, find, isPrefixOf)
    import Data.Maybe (fromJust)
    a208241 = genericIndex a208241_list
    a208241_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 `isPrefixOf`) . snd) pps'
       nns = zip [1..] $ map reverse $ tail a030308_tabf
  • Maple
    A208241 := proc(n)
        local nbin,len,suf,sufbin,pbin,p ;
        nbin := convert(n,base,2) ;
        for len from 1 do
            for suf from 0 to 2^len-1 do
                sufbin := convert(suf,base,2) ;
                while nops(sufbin) < len do
                    sufbin := [op(sufbin),0] ;
                end do:
                pbin := [op(sufbin),op(nbin)] ;
                p := add( 2^(i-1)*op(i,pbin),i=1..nops(pbin) ) ;
                if isprime(p) then
                    return p ;
                end if;
            end do:
        end do:
    end proc:
    seq(A208241(n),n=1..50) ; # R. J. Mathar, May 06 2017

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 *)
Showing 1-3 of 3 results.