login
A004287
Least positive multiple of n written in base 7 using only 0 and 1.
2
1, 11, 111, 11, 101, 111111, 10, 11, 1011, 101, 10011, 111111, 1011, 110, 11001, 1111, 100111, 1101111, 111, 1111, 1110, 11101, 101011, 111111, 101, 111001, 1011, 110, 1111111, 1011111, 100111, 11011, 10011, 100111, 1010, 1101111
OFFSET
1,2
LINKS
MATHEMATICA
With[{cl=Rest[{FromDigits[#, 7], FromDigits[#]}&/@Tuples[{0, 1}, 7]]}, Table[ SelectFirst[ cl, Mod[#[[1]], n]==0&], {n, 40}]][[;; , 2]] (* Harvey P. Dale, Jan 31 2024 *)
PROG
(Python)
def A004287(n):
if n > 0:
for i in range(1, 2**n):
s = bin(i)[2:]
if not int(s, 7) % n:
return int(s)
return 0 # Chai Wah Wu, Dec 30 2014
CROSSREFS
Cf. A244958 (written in base 10).
Sequence in context: A055016 A259372 A348871 * A061493 A093788 A327992
KEYWORD
nonn,base
EXTENSIONS
Removed initial 0 since (1) it did not match the definition, and (2) there are many similar sequences with the same author which also say "positive". Also changed offset. - N. J. A. Sloane, Jan 31 2024
Previous b-file replaced by Harvey P. Dale, Jan 31 2024
STATUS
approved