A317777
Numbers whose digital sums in bases 2, 3, 4, and 5 are all equal.
Original entry on oeis.org
1, 23162843828305, 5722224662500629, 25185954575304707081301, 407805072367801818857674005, 1705412607407578552438012746487125, 1705412607426764386750185803694405, 1705412607426764386750185803695125, 1705412607426764386750186877112645, 1705412607431411795338502226662661
Offset: 1
23162843828305 in bases 2, 3, 4, and 5 is equal to 101010001000100000101000101000001000001010001, 10001000100100102010101011001, 11101010011011001001101, and 11014000001010001210, respectively. The sum of the digits is 13 in all four cases.
A335051
a(n) is the smallest decimal number > 1 such that when it is written in all bases from base 2 to base n those numbers all contain both 0 and 1.
Original entry on oeis.org
2, 9, 19, 28, 145, 384, 1128, 2601, 2601, 101256, 103824, 382010, 572101, 971400, 1773017, 1773017, 22873201, 64041048, 64041048, 1193875201, 2496140640, 10729882801, 21660922801, 120068616277, 333679563001, 427313653201, 427313653201, 10436523921264, 10868368953601
Offset: 2
a(3) = 9 as 9_2 = 1001 and 9_3 = 100, both of which contain a 0 and 1.
a(6) = 145 as 145_2 = 10010001, 145_3 = 12101, 145_4 = 2101, 145_5 = 1040, 145_6 = 401, all of which contain a 0 and 1.
a(9) = 2601 as 2601_2 = 101000101001, 2601_3 = 10120100, 2601_4 = 220221, 2601_5 = 40401, 2602_6 = 20013, 2601_7 = 10404, 2601_8 = 5051, 2601_9 = 3510, all of which contain a 0 and 1. Note that, as 2601 also contains a 0 and 1, a(10) = 2601.
a(16) = 1773017 as 1773017_2 = 110110000110111011001, 1773017_3 = 10100002010022, 1773017_4 = 12300313121, 1773017_5 = 423214032, 1773017_6 = 102000225, 1773017_7 = 21033101, 1773017_8 = 6606731, 1773017_9 = 3302108, 1773017_10 = 1773017, 1773017_11 = 1001104, 1773017_12 = 716075, 1773017_13 = 4A102C, 1773017_14 = 342201, 1773017_15 = 250512, 1773017_16 = 1B0DD9, all of which contain a 0 and 1.
-
a[n_] := Block[{k=2}, While[ AnyTrue[ Range[n, 2, -1], ! SubsetQ[ IntegerDigits[k, #], {0, 1}] &], k++]; k]; a /@ Range[2, 13] (* Giovanni Resta, May 24 2020 *)
-
from numba import njit
@njit
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
return has0 and (has1 or n==1)
@njit
def a(n, start=2):
k = start
while True:
for b in range(n, 1, -1):
if not hasdigits01(k, b): break
else: return k
k += 1
anm1 = 2
for n in range(2, 21):
an = a(n, start=anm1)
print(an, end=", ")
anm1 = an # Michael S. Branicky, Feb 09 2021
A335066
Decimal numbers such that when they are written in all bases from 2 to 10 those numbers all share a common digit (the digit 0 or 1).
Original entry on oeis.org
1, 81, 91, 109, 127, 360, 361, 417, 504, 540, 541, 631, 661, 720, 781, 841, 918, 981, 991, 1008, 1009, 1039, 1080, 1081, 1088, 1089, 1090, 1091, 1093, 1099, 1105, 1111, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1128, 1134, 1135, 1136, 1137, 1138, 1139
Offset: 1
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.
-
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
Showing 1-3 of 3 results.
Comments