This site is supported by donations to The OEIS Foundation.

 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

%I

%S 1,11,10,11,101,110,1001,1111,100,101,11111,110,111,1001,1010,11011,

%T 10011,1100,100011,1111,10010,111001,100101,11110,110001,111111,1000,

%U 1001,1011011,1010,1011,100111,111110,1011111,101101,1100,1101

%N Least positive multiple of n written in base 3 using only 0 and 1.

%H Robert Israel, <a href="/A004283/b004283.txt">Table of n, a(n) for n = 1..10000</a>

%p h:= proc(n)

%p option remember;

%p local t,x;

%p t:= n mod 3;

%p if t = 2 then -1

%p else

%p x:= procname((n-t)/3);

%p if x = -1 then -1

%p else 10*x + t

%p fi

%p fi

%p end proc:

%p h(0):= 0:

%p h(1):= 1:

%p A004283:= proc(n) local k,r;

%p for k from 1 do

%p r:= h(k*n);

%p if r <> -1 then return r fi

%p od

%p end proc:

%p seq(A004283(n),n=1..100); # _Robert Israel_, Dec 26 2015

%o (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

%Y Cf. A005836.

%K nonn,base

%O 1,2

%A _David W. Wilson_

%E a(34) corrected by _Sean A. Irvine_, Dec 26 2015

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

Last modified September 22 12:42 EDT 2019. Contains 327307 sequences. (Running on oeis4.)