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

A262958 Numbers whose base-b expansions, for both b=3 and b=4, include no digits other than 1 and b-1.

Original entry on oeis.org

1, 5, 7, 13, 23, 53, 125, 215, 373, 1367, 1373, 1375, 3551, 4093, 5471, 5495, 5503, 30581, 30589, 32765, 32767, 56821, 56831, 89557, 96119, 96215, 96223, 97655, 98135, 98141, 98143, 98167, 98293, 98303, 351743, 352093, 521599, 521693, 521717, 521719, 524119, 524149, 875893, 875903, 884725, 884735
Offset: 1

Views

Author

Robin Powell, Oct 05 2015

Keywords

Comments

1, 7 and 32767 also share this property in base 2; their binary expansions consist only of a sequence of 1s.

Examples

			53 is 1222 in base 3 and 311 in base 4; it only uses the digit 1 or the largest digit in the two bases and is therefore a term.
Similarly 215 is 21222 in base 3 and 3113 in base 4 so it is also a term.
		

Crossrefs

Programs

  • Mathematica
    Select[Range@ 1000000, Last@ DigitCount[#, 3] == 0 && Total@ Rest@ Drop[DigitCount[#, 4], {3}] == 0 &] (* Michael De Vlieger, Oct 05 2015 *)
    Join[{1,5},Flatten[Table[Select[FromDigits[#,3]&/@Tuples[{1,2},n], Union[ IntegerDigits[ #,4]] =={1,3}&],{n,20}]]] (* Harvey P. Dale, Jun 14 2016 *)
  • PARI
    is(n)=!setsearch(Set(digits(n,3)),0) && #setintersect(Set(digits(n,4)),[0,2])==0 \\ Charles R Greathouse IV, Oct 12 2015
    
  • Python
    from gmpy2 import digits
    def f1(n):
        s = digits(n,3)
        m = len(s)
        for i in range(m):
            if s[i] == '0':
                return(int(s[:i]+'1'*(m-i),3))
        return n
    def f2(n):
        s = digits(n,4)
        m = len(s)
        for i in range(m):
            if s[i] == '0':
                return(int(s[:i]+'1'*(m-i),4))
            if s[i] == '2':
                return(int(s[:i]+'3'+'1'*(m-i-1),4))
        return n
    A262958_list = []
    n = 1
    for i in range(10**4):
        m = f2(f1(n))
        while m != n:
            n, m = m, f2(f1(m))
        A262958_list.append(m)
        n += 1 # Chai Wah Wu, Oct 30 2015

A262963 List of numbers n whose base-3 expansion contains only the digits 1 and 2 and whose base-4 expansion contains only the digits 2 and 3.

Original entry on oeis.org

2, 14, 43, 238, 239, 698, 4010, 4090, 4091, 4094, 10922, 12031, 12271, 12283, 174842, 174847, 176062, 176063, 977578, 977579, 981679, 981691, 981931, 981934, 981935, 981950, 1043114, 1043194, 1043195, 1043198, 3129259, 3129262, 3129263, 3129322, 3129323, 3129326, 3129343
Offset: 1

Views

Author

Robin Powell, Oct 05 2015

Keywords

Examples

			43 is 1121 in base 3 and 223 in base 4; it uses the two largest digits in the two bases and is therefore a term.
Similarly 238 is 22211 in base 3 and 3232 in base 4 so it is also a term.
		

Crossrefs

Programs

  • Python
    from gmpy2 import digits
    def f1(n):
        s = digits(n,3)
        m = len(s)
        for i in range(m):
            if s[i] == '0':
                return(int(s[:i]+'1'*(m-i),3))
        return n
    def f2(n):
        s = digits(n,4)
        m = len(s)
        for i in range(m):
            if s[i] in ['0','1']:
                return(int(s[:i]+'2'*(m-i),4))
        return n
    A262963_list = []
    n = 1
    for i in range(10**4):
        m = f2(f1(n))
        while m != n:
            n, m = m, f2(f1(m))
        A262963_list.append(m)
        n += 1 # Chai Wah Wu, Oct 30 2015
Showing 1-2 of 2 results.