login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A004283 Least positive multiple of n written in base 3 using only 0 and 1. 3
1, 11, 10, 11, 101, 110, 1001, 1111, 100, 101, 11111, 110, 111, 1001, 1010, 11011, 10011, 1100, 100011, 1111, 10010, 111001, 100101, 11110, 110001, 111111, 1000, 1001, 1011011, 1010, 1011, 100111, 111110, 1011111, 101101, 1100, 1101 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
MAPLE
h:= proc(n)
option remember;
local t, x;
t:= n mod 3;
if t = 2 then -1
else
x:= procname((n-t)/3);
if x = -1 then -1
else 10*x + t
fi
fi
end proc:
h(0):= 0:
h(1):= 1:
A004283:= proc(n) local k, r;
for k from 1 do
r:= h(k*n);
if r <> -1 then return r fi
od
end proc:
seq(A004283(n), n=1..100); # Robert Israel, Dec 26 2015
MATHEMATICA
lpm3[n_]:=Module[{k=1}, While[DigitCount[k*n, 3, 2]>0, k++]; FromDigits[ IntegerDigits[ k*n, 3]]]; Array[lpm3, 40] (* Harvey P. Dale, Mar 02 2020 *)
PROG
(PARI) a(n) = {k=1; while (vecmax(digits(k*n, 3)) != 1, k++); subst(Pol(digits(k*n, 3)), x, 10); } \\ Michel Marcus, Dec 27 2015
CROSSREFS
Cf. A005836.
Sequence in context: A182782 A217789 A347765 * A344367 A106421 A019329
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
a(34) corrected by Sean A. Irvine, Dec 26 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 08:22 EDT 2024. Contains 371236 sequences. (Running on oeis4.)