OFFSET
1,2
COMMENTS
As base 2 is included the only possible common digit between all the bases is either a 0 or 1.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
1 is a term as 1 written in all bases is 1.
81 is a term as 81_2 = 1010001, 81_3 = 10000, 81_4 = 1101, 81_5 = 311, 81_6 = 213, 81_7 = 144, 81_8 121, 81_9 = 100, 81_10 = 81, all of which contain the digit 1.
360 is a term as 360_2 = 101101000, 360_3 = 111100, 360_4 = 11220, 360_5 = 2420, 360_6 = 1400, 360_7 = 1023, 360_8 = 550, 360_9 = 550, 360_10 = 360, all of which contain the digit 0.
PROG
(Python)
def hasdigits01(n, b):
has0, has1 = False, False
while n >= b:
n, r = divmod(n, b)
if r == 0: has0 = True
if r == 1: has1 = True
if has0 and has1: return (True, True)
return (has0, has1 or n==1)
def ok(n):
all0, all1 = True, True
for b in range(10, 1, -1):
has0, has1 = hasdigits01(n, b)
all0 &= has0; all1 &= has1
if not all0 and not all1: return False
return all0 or all1
print([k for k in range(1140) if ok(k)]) # Michael S. Branicky, May 23 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Scott R. Shannon and Zach J. Shannon, May 22 2020
STATUS
approved