VOOZH about

URL: https://oeis.org/A389119

⇱ A389119 - OEIS


login
A389119
Numbers that only use the digits 0 and 1 in both base 3 and 10.
1
0, 1, 10, 111, 1000, 1011, 11110101001101, 11110101001110, 11110101001111, 11110101010011, 11110101010101, 1100111000010111011100, 1100111000010111011101
OFFSET
1,3
COMMENTS
a(14) >= 10^312 if it exists.
a(14) >= 10^50000 if it exists. - Andrew Howroyd, Sep 26 2025
EXAMPLE
1011 = 1101110_3.
PROG
(Python)
from gmpy2 import digits, mpz
from itertools import count, islice
def agen(): yield from (int(b) for k in count(0) if '2' not in digits(mpz((b:=bin(k)[2:]), 10), 3))
print(list(islice(agen(), 13))) # Michael S. Branicky, Sep 24 2025
(Python) # see links for translation of Andrew Howroyd's PARI
(PARI)
okrange(lb, ub)={my(u=digits(lb, 3), v=digits(ub, 3)); if(#u < #v, 1, my(k=1); while(u[k]!= 2 && u[k]==v[k], k++); u[k]!=2)}
nexta(lb, ub)={
my(recurse(b, m)=
if(m==1, if(b>lb && vecmax(digits(b, 3))==1 && b<ub, b, oo),
if(okrange(b, b+(m-1)/9), m/=10; my(r=self()(b, m)); if(r==oo, r=self()(b+m, m)); r, oo));
);
if(lb<0, 0, my(m=1, r=oo); while(r==oo &&m<ub, if(m*10>lb, r=recurse(m, m)); m*=10); r)
}
{ my(k=0); while(k<oo, print1(k, ", "); k=nexta(k, 10^40)) } \\ Andrew Howroyd, Sep 26 2025
CROSSREFS
Intersection of A005836 and A007088.
Sequence in context: A257344 A244859 A159551 * A105991 A284352 A103581
KEYWORD
nonn,base
AUTHOR
Rhys Feltman, Sep 23 2025
STATUS
approved