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.

A038102 Numbers k such that k is a substring of its base-2 representation.

Original entry on oeis.org

0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1100, 1101, 10000, 10001, 10011, 10100, 10101, 10111, 11000, 11001, 11100, 11101, 100000, 100001, 101000, 101010, 101100, 101101, 101111, 110000, 110001, 110101, 111100, 111101, 1000000
Offset: 1

Views

Author

Patrick De Geest, Feb 15 1999

Keywords

Examples

			101000_10 = 1100010{101000}1000_2.
		

Crossrefs

Programs

  • Mathematica
    Select[FromDigits /@ IntegerDigits[Range[2^15]-1, 2], StringPosition[StringJoin @@ (ToString /@ IntegerDigits[#, 2]), ToString@#] != {} &] (* terms < 10^15, Giovanni Resta, Apr 30 2013 *)
    f[n_] := Block[{a = FromDigits@ IntegerDigits[n, 2]}, If[ StringPosition[ ToString@ FromDigits@ IntegerDigits[ a, 2], ToString@ a] != {}, a, 0]]; k = 0; lst = {}; While[k < 65, AppendTo[lst, f@k]; lst = Union@ lst; k++]; lst (* Robert G. Wilson v, Jun 29 2014 *)
  • PARI
    {for(vv=0, 200, bvv=binary(vv);
    mm=length(bvv); texp=0; btod=0;
    forstep(i=mm, 1, -1, btod=btod+bvv[i]*10^texp; texp++);
    bigb=binary(btod); lbb=length(bigb); swsq=1;
    for(k=0, lbb - mm , for(j=1, mm, if(bvv[j]!=bigb[j+k], swsq=0));
    if(swsq==1, print1(btod, ", "); break, swsq=1)))}
    \\\ Douglas Latimer, Apr 29 2013
    
  • Python
    from itertools import count, islice, product
    def ok(n): return int(max(str(n))) < 2 and str(n) in bin(n)
    def agen(): # generator of terms
        yield 0
        for d in count(1):
            for rest in product("01", repeat=d-1):
                k = int("1" + "".join(rest))
                if ok(k):
                    yield k
    print(list(islice(agen(), 35))) # Michael S. Branicky, Jan 04 2022

A038106 Numbers k with the property that k is a substring of its base-6 representation.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 45240, 45241, 45242, 45243, 45244, 45245, 54000, 54001, 54002, 54003, 54004, 54005, 304200, 304201, 304202, 304203, 304204, 304205, 3240000, 3240001, 3240002, 3240003, 3240004, 3240005, 3544200, 3544201, 3544202
Offset: 1

Views

Author

Patrick De Geest, Feb 15 1999

Keywords

Examples

			304201_10 = 10{304201}_6.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0,355*10^4],SequenceCount[IntegerDigits[#,6],IntegerDigits[#]]>0&] (* Harvey P. Dale, Mar 11 2023 *)

A307256 Numbers k such that k is the substring identical to the most significant digits of its base-5 representation.

Original entry on oeis.org

0, 1, 2, 3, 4, 124343, 124401, 132114, 10032011, 20122404, 30213311, 40304213, 1333204002110, 1411043040042, 101232041210022, 203110224214344, 210011311131122, 304342321033141, 311243402442011, 311300321024140, 413122042420324, 420023124324311, 14233443213321013401
Offset: 1

Views

Author

Scott R. Shannon, Apr 01 2019

Keywords

Comments

Numbers k whose base-5 representation begins with the same digits as k itself.

Examples

			132114_10 = 13211424_5, which also begins with '132114'.
		

Crossrefs

This is a subsequence of A038105.

Programs

  • Mathematica
    With[{b = 5}, Select[Array[{FromDigits@ #, #} &@ IntegerDigits[#, b] &, b^10, 0], Take[IntegerDigits[First@ #, b], Length@ Last@ #] == Last[#] &][[All, 1]]] (* Michael De Vlieger, Apr 01 2019 *)
Showing 1-3 of 3 results.