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.

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

This page as a plain text file.
%I A262958 #26 Jun 14 2016 16:25:26
%S A262958 1,5,7,13,23,53,125,215,373,1367,1373,1375,3551,4093,5471,5495,5503,
%T A262958 30581,30589,32765,32767,56821,56831,89557,96119,96215,96223,97655,
%U A262958 98135,98141,98143,98167,98293,98303,351743,352093,521599,521693,521717,521719,524119,524149,875893,875903,884725,884735
%N A262958 Numbers whose base-b expansions, for both b=3 and b=4, include no digits other than 1 and b-1.
%C A262958 1, 7 and 32767 also share this property in base 2; their binary expansions consist only of a sequence of 1s.
%H A262958 Chai Wah Wu, <a href="/A262958/b262958.txt">Table of n, a(n) for n = 1..10000</a>
%e A262958 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.
%e A262958 Similarly 215 is 21222 in base 3 and 3113 in base 4 so it is also a term.
%t A262958 Select[Range@ 1000000, Last@ DigitCount[#, 3] == 0 && Total@ Rest@ Drop[DigitCount[#, 4], {3}] == 0 &] (* _Michael De Vlieger_, Oct 05 2015 *)
%t A262958 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 *)
%o A262958 (PARI) is(n)=!setsearch(Set(digits(n,3)),0) && #setintersect(Set(digits(n,4)),[0,2])==0 \\ _Charles R Greathouse IV_, Oct 12 2015
%o A262958 (Python)
%o A262958 from gmpy2 import digits
%o A262958 def f1(n):
%o A262958     s = digits(n,3)
%o A262958     m = len(s)
%o A262958     for i in range(m):
%o A262958         if s[i] == '0':
%o A262958             return(int(s[:i]+'1'*(m-i),3))
%o A262958     return n
%o A262958 def f2(n):
%o A262958     s = digits(n,4)
%o A262958     m = len(s)
%o A262958     for i in range(m):
%o A262958         if s[i] == '0':
%o A262958             return(int(s[:i]+'1'*(m-i),4))
%o A262958         if s[i] == '2':
%o A262958             return(int(s[:i]+'3'+'1'*(m-i-1),4))
%o A262958     return n
%o A262958 A262958_list = []
%o A262958 n = 1
%o A262958 for i in range(10**4):
%o A262958     m = f2(f1(n))
%o A262958     while m != n:
%o A262958         n, m = m, f2(f1(m))
%o A262958     A262958_list.append(m)
%o A262958     n += 1 # _Chai Wah Wu_, Oct 30 2015
%Y A262958 Cf. A207079, A258981, A261970.
%K A262958 nonn,base
%O A262958 1,2
%A A262958 _Robin Powell_, Oct 05 2015