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.

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

A261201 Base-10 representation of A261200.

Original entry on oeis.org

1, 2, 5, 11, 23, 47, 191, 383, 3067, 12269, 196307, 6281839, 50254717, 201018869, 804075479, 1608150959, 102921661397, 1646746582367, 13173972658937, 105391781271503, 210783562543007, 3372537000688127, 26980296005505019, 863369472176160611
Offset: 1

Views

Author

Clark Kimberling, Sep 16 2015

Keywords

Crossrefs

A055011, A261200 and A261201 are all essentially the same sequence.

Programs

  • Mathematica
    b = 2; s = {{1}};
    Do[NestWhile[# + 1 &, 0, ! (PrimeQ[FromDigits[tmp = Join[Last[s], (nn = #;           IntegerDigits[nn - Sum[b^n, {n, l = NestWhile[# + 1 &, 1, ! (nn - (Sum[b^n, {n, #}]) < 0) &] - 1}], b, l + 1])], b]]) &];
    AppendTo[s, tmp], {30}]; Map[FromDigits, s]
    Map[FromDigits, s] (* A261200 *)
    Map[FromDigits[#, b] &, s] (* A261201 *)
    (* Peter J. C. Moses, Aug 06 2015 *)

A261200 Minimal prime concatenation sequence with base 2 and seed 1.

Original entry on oeis.org

1, 10, 101, 1011, 10111, 101111, 10111111, 101111111, 101111111011, 10111111101101, 101111111011010011, 10111111101101001101111, 10111111101101001101111101, 1011111110110100110111110101, 101111111011010011011111010111, 1011111110110100110111110101111
Offset: 1

Views

Author

Clark Kimberling, Sep 16 2015

Keywords

Examples

			In base 2, the least prime starting with seed 1 is 10; the least prime starting with 10 is 101; the least prime starting with 101 is 1011. Triangular format:
1
10
101
1011
10111
101111
10111111
101111111
101111111011
		

Crossrefs

A055011, A261200 and A261201 are all essentially the same sequence.

Programs

  • Mathematica
    b = 2; s = {{1}};
    Do[NestWhile[# + 1 &, 0, ! (PrimeQ[FromDigits[tmp = Join[Last[s], (nn = #; IntegerDigits[nn - Sum[b^n, {n, l = NestWhile[# + 1 &, 1, ! (nn - (Sum[b^n, {n, #}]) < 0) &] - 1}], b, l + 1])], b]]) &];
    AppendTo[s, tmp], {30}]; Map[FromDigits, s]
    Map[FromDigits, s] (* A261200 *)
    Map[FromDigits[#, b] &, s] (* A261201 *)
    (* Peter J. C. Moses, Aug 06 2015 *)
Showing 1-3 of 3 results.