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-4 of 4 results.

A350573 Base-10 version of A038103 interpreted as base 3.

Original entry on oeis.org

0, 1, 2, 3, 6, 7, 11, 12, 21, 22, 23, 24, 31, 41, 43, 62, 145, 146, 149, 152, 2626, 2627, 4370, 8463, 8466, 13562, 20841, 42320, 43171, 46609, 47749, 48150, 52723, 55179, 55180, 55181
Offset: 1

Views

Author

Hans Havermann, Jan 06 2022

Keywords

Crossrefs

Programs

  • Mathematica
    B3[n_] := FromDigits[IntegerDigits[n, 3]]
    SP[n_] := (b = B3[n]; StringPosition[ToString[B3[b]], ToString[b]])
    n=0; t={}; While[n<10^6, If[SP[n]!={}, AppendTo[t, n]]; n++]; t
  • Python
    from sympy.ntheory.digits import digits
    from itertools import count, islice, product
    def agen(): # generator of terms
        yield 0
        for d in count(1):
            for first in "12":
                for rest in product("012", repeat=d-1):
                    s = first + "".join(rest)
                    if s in "".join(str(d) for d in digits(int(s), 3)[1:]):
                        yield int(s, 3)
    print(list(islice(agen(), 36))) # Michael S. Branicky, Jan 06 2022
    
  • Python
    from itertools import count, islice
    from gmpy2 import digits
    def A350573_gen(): return (n for n in count(0) if (s:=digits(n,3)) in digits(int(s),3))
    A350573_list = list(islice(A350573_gen(),30)) # Chai Wah Wu, Jan 09 2022

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

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

Original entry on oeis.org

0, 1, 2, 10, 20, 21, 102, 110, 212, 220, 1112, 12112, 100120102112, 201012211212, 1012020201210, 2111021022020, 11100220111211, 22201211020121, 112201021022110, 120202121012200, 1222102100221101, 1000102100102121221002, 2000211201000000212101, 10102022202100111202222
Offset: 1

Views

Author

Scott R. Shannon, Apr 01 2019

Keywords

Comments

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

Examples

			220_10 = 22011_3, which also begins with '220'.
		

Crossrefs

This is a subsequence of A038103.

Programs

  • PARI
    isok(n) = my(vb=digits(n, 3), vd=digits(n)); vd == vector(#vd, k, vb[k]); \\ Michel Marcus, Apr 08 2019

A350508 Numbers whose base-10 representation is a (scattered) subsequence of their base-3 representation.

Original entry on oeis.org

0, 1, 2, 10, 20, 21, 100, 102, 110, 111, 210, 211, 212, 220, 221, 222, 1000, 1010, 1011, 1020, 1021, 1022, 1110, 1111, 1112, 1121, 1122, 2000, 2001, 2010, 2011, 2012, 2021, 2022, 12101, 12102, 12111, 12112, 12120, 12121, 12122, 12201, 12202, 12221, 12222, 20220
Offset: 1

Views

Author

Jeffrey Shallit, Jan 02 2022

Keywords

Comments

Not known to be infinite.
Stan Wagon observed in an e-mail message to me (January 1 2022) that 2022 has this property, and remarked that this "will not happen again for a very long time". - Jeffrey Shallit, Jan 02 2022

Examples

			The base-3 representation of 2022 is 2202220, and 2022 is a subsequence of that.
		

Crossrefs

Cf. A038103, which deals with contiguous substrings instead of subsequences.

Programs

  • PARI
    is(n) = { if (n && vecmax(digits(n))>=3, return (0)); my (t=n); while (n && t, if (n%10==t%3, n\=10); t\=3); n==0 } \\ Rémy Sigrist, Jan 02 2022
    
  • Python
    from itertools import count, islice, product
    def ok(n): # after Remy Sigrist
        if n and int(max(str(n))) >= 3: return False
        t = n
        while n and t:
            if n%10 == t%3:
                n //= 10
            t //= 3
        return n == 0
    def agen(): # generator of terms
        yield 0
        for d in count(1):
            for first in "12":
                for rest in product("012", repeat=d-1):
                    k = int(first + "".join(rest))
                    if ok(k):
                        yield k
    print(list(islice(agen(), 46))) # Michael S. Branicky, Jan 02 2022

Extensions

a(1) = 0 prepended by Rémy Sigrist, Jan 02 2022
Showing 1-4 of 4 results.