A342348 Smallest number > 3 whose representation in all bases from 2 up to n consists only of '0's, '1's, '2's and '3's.
4, 4, 4, 5, 6, 7, 8, 8281
Offset: 2
Examples
a(9) = 8281. 8281 in base 2 = 10000001011001 8281 in base 3 = 102100201 8281 in base 4 = 2001121 8281 in base 5 = 231111 8281 in base 6 = 102201 8281 in base 7 = 33100 8281 in base 8 = 20131 8281 in base 9 = 12321
Crossrefs
Cf. A258107.
Programs
-
Python
def only0123(n, b): while n >= b: n, r = divmod(n, b) if r > 3: return False return n <= 3 def a(n): k = max(4, n) while not all(only0123(k, b) for b in range(2, n+1)): k += 1 return k print([a(n) for n in range(2, 10)]) # Michael S. Branicky, Mar 12 2021
Comments